Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Unity-Technologies/bdwgc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'alloc.c')
-rw-r--r--alloc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/alloc.c b/alloc.c
index c3562bae..f3d66540 100644
--- a/alloc.c
+++ b/alloc.c
@@ -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);
}