Commit e4c2f9c1 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1585 from cremno/codegen-fixes

codegen_malloc/realloc: static + simple mem alloc
parents 956e26be ec9b5e7f
......@@ -113,19 +113,19 @@ codegen_palloc(codegen_scope *s, size_t len)
return p;
}
void*
static void*
codegen_malloc(codegen_scope *s, size_t len)
{
void *p = mrb_malloc(s->mrb, len);
void *p = mrb_malloc_simple(s->mrb, len);
if (!p) codegen_error(s, "mrb_malloc");
return p;
}
void*
static void*
codegen_realloc(codegen_scope *s, void *p, size_t len)
{
p = mrb_realloc(s->mrb, p, len);
p = mrb_realloc_simple(s->mrb, p, len);
if (!p && len > 0) codegen_error(s, "mrb_realloc");
return p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment