mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add call to malloc_trim on a full GC
This commit is contained in:
committed by
Yukihiro "Matz" Matsumoto
parent
cfe8b0c81d
commit
dae0de4461
@@ -6,6 +6,9 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef HAS_MALLOC_TRIM
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <mruby.h>
|
||||
#include <mruby/array.h>
|
||||
#include <mruby/class.h>
|
||||
@@ -1319,6 +1322,9 @@ mrb_full_gc(mrb_state *mrb)
|
||||
gc->full = FALSE;
|
||||
}
|
||||
|
||||
#ifdef HAS_MALLOC_TRIM
|
||||
malloc_trim(0);
|
||||
#endif
|
||||
GC_TIME_STOP_AND_REPORT;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user