Permalink
Browse files

Revert 4566c80; fix #3679

The patch deallocate the memory in `mrb_default_allocf` but that
hinders GC in `mrb_realloc`.
  • Loading branch information...
matz committed May 31, 2017
1 parent 877f9d0 commit 7dbbd774076a99e7afc7e9b3ba27f9feac1bfa4b
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/state.c
View
@@ -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 {

0 comments on commit 7dbbd77

Please sign in to comment.