summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gc.c b/src/gc.c
index 6dc8e373b..94068c0f9 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -277,6 +277,13 @@ mrb_free(mrb_state *mrb, void *p)
(mrb->allocf)(mrb, p, 0, mrb->allocf_ud);
}
+MRB_API void*
+mrb_alloca(mrb_state *mrb, size_t size)
+{
+ mrb_value str = mrb_str_new(mrb, NULL, size);
+ return RSTRING_PTR(str);
+}
+
static mrb_bool
heap_p(mrb_gc *gc, struct RBasic *object)
{