diff options
Diffstat (limited to 'alloc.c')
-rw-r--r-- | alloc.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -367,6 +367,12 @@ STATIC void GC_clear_a_few_frames(void) /* limits used by blacklisting. */ STATIC word GC_collect_at_heapsize = (word)(-1); STATIC GC_bool GC_should_start_incremental_collection = FALSE; +STATIC GC_bool GC_disable_automatic_collection = FALSE; + +GC_API void GC_set_disable_automatic_collection(GC_bool disable) +{ + GC_disable_automatic_collection = disable; +} GC_API void GC_start_incremental_collection() { @@ -391,6 +397,8 @@ GC_INNER GC_bool GC_should_collect(void) GC_should_start_incremental_collection = FALSE; return TRUE; } + if (GC_disable_automatic_collection) + return FALSE; return(GC_adj_bytes_allocd() >= last_min_bytes_allocd || GC_heapsize >= GC_collect_at_heapsize); } |