summaryrefslogtreecommitdiffstats
path: root/byterun/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/memory.c')
-rw-r--r--byterun/memory.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/byterun/memory.c b/byterun/memory.c
index 54d91c96d..529e5b248 100644
--- a/byterun/memory.c
+++ b/byterun/memory.c
@@ -581,6 +581,14 @@ CAMLexport void * caml_stat_alloc (asize_t sz)
return result;
}
+CAMLexport char * caml_stat_alloc_string(value str)
+{
+ mlsize_t sz = caml_string_length(str) + 1;
+ char * p = caml_stat_alloc(sz);
+ memcpy(p, String_val(str), sz);
+ return p;
+}
+
CAMLexport void caml_stat_free (void * blk)
{
free (blk);