mrb_default_allocf() is default allocator for NULL safe

This commit is contained in:
dearblue
2019-02-09 20:22:08 +09:00
parent fc883de458
commit eb6aee117b
+1
View File
@@ -26,6 +26,7 @@ mrb_open_core(mrb_allocf f, void *ud)
static const struct mrb_context mrb_context_zero = { 0 };
mrb_state *mrb;
if (f == NULL) f = mrb_default_allocf;
mrb = (mrb_state *)(f)(NULL, NULL, sizeof(mrb_state), ud);
if (mrb == NULL) return NULL;