summaryrefslogtreecommitdiff
path: root/allocator.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-06-26 15:37:12 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-06-26 15:37:12 -0400
commit35d80c91353a4a0b1d6d5575a481e3c2afeb2a06 (patch)
tree825938acbcfb68b2d64af68fa4cc7d9ce1178772 /allocator.c
parent4ab1fd88714fe4314bef7b1cc2429c655e482540 (diff)
finished moving #include to parsing
Diffstat (limited to 'allocator.c')
-rw-r--r--allocator.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/allocator.c b/allocator.c
index 98005ef..f3fbff6 100644
--- a/allocator.c
+++ b/allocator.c
@@ -114,3 +114,10 @@ static void allocr_free_all(Allocator *a) {
page = next;
}
}
+
+static char *allocr_str_to_cstr(Allocator *a, String s) {
+ char *ret = allocr_malloc(a, s.len + 1);
+ memcpy(ret, s.str, s.len);
+ ret[s.len] = 0;
+ return ret;
+}