summaryrefslogtreecommitdiff
path: root/allocator.c
diff options
context:
space:
mode:
Diffstat (limited to 'allocator.c')
-rw-r--r--allocator.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/allocator.c b/allocator.c
index acfe7a8..cf747ab 100644
--- a/allocator.c
+++ b/allocator.c
@@ -107,7 +107,12 @@ static void *allocr_realloc(Allocator *a, void *data, size_t old_size, size_t ne
return ret;
}
-
+static char *allocr_strdup(Allocator *a, char const *s) {
+ size_t len = strlen(s);
+ char *ret = allocr_malloc(a, len);
+ memcpy(ret, s, len);
+ return ret;
+}
static void allocr_free_all(Allocator *a) {
for (Page *page = a->first; page;) {