summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib.c8
-rw-r--r--lib.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 44ef6b0e..7c45907f 100644
--- a/lib.c
+++ b/lib.c
@@ -2358,6 +2358,14 @@ char *chk_strdup_utf8(const char *str)
return copy;
}
+mem_t *chk_copy_obj(mem_t *orig, size_t size)
+{
+ mem_t *copy = chk_malloc(size);
+ assert (!async_sig_enabled);
+ memcpy(copy, orig, size);
+ return copy;
+}
+
val cons(val car, val cdr)
{
val obj = make_obj();
diff --git a/lib.h b/lib.h
index 0872c089..7b2a4f0f 100644
--- a/lib.h
+++ b/lib.h
@@ -561,6 +561,7 @@ mem_t *chk_manage_vec(mem_t *old, size_t oldfilled, size_t newfilled,
wchar_t *chk_wmalloc(size_t nwchar);
wchar_t *chk_strdup(const wchar_t *str);
char *chk_strdup_utf8(const char *str);
+mem_t *chk_copy_obj(mem_t *orig, size_t size);
val cons(val car, val cdr);
val make_lazy_cons(val func);
val make_half_lazy_cons(val func, val car);