mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
+4
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user