Revert 4566c80; fix #3679

The patch deallocate the memory in `mrb_default_allocf` but that
hinders GC in `mrb_realloc`.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-05-31 23:01:04 +09:00
parent 877f9d02e6
commit 7dbbd77407
+4 -4
View File
@@ -52,13 +52,13 @@ mrb_open_core(mrb_allocf f, void *ud)
void*
mrb_default_allocf(mrb_state *mrb, void *p, size_t size, void *ud)
{
void *p2;
if (size == 0 || (p2 = realloc(p, size)) == NULL) {
if (size == 0) {
free(p);
return NULL;
}
return p2;
else {
return realloc(p, size);
}
}
struct alloca_header {