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:
authorJonas Echterhoff <jonas@unity3d.com>2020-05-26 11:19:25 +0300
committerJonas Echterhoff <jonas@unity3d.com>2020-05-26 11:19:25 +0300
commit0480a661fed6149741aeb318f8aa31a96d9182cb (patch)
tree9ddd2684c5de680be2f4268f4d26446de8863f40
parent7027029e20978c23787d5801d9098016e51133c3 (diff)
Change name; also start collection
-rw-r--r--alloc.c14
-rw-r--r--include/gc.h2
2 files changed, 10 insertions, 6 deletions
diff --git a/alloc.c b/alloc.c
index af51ffcd..e125e29b 100644
--- a/alloc.c
+++ b/alloc.c
@@ -366,11 +366,15 @@ STATIC void GC_clear_a_few_frames(void)
/* Heap size at which we need a collection to avoid expanding past */
/* limits used by blacklisting. */
STATIC word GC_collect_at_heapsize = (word)(-1);
-STATIC GC_bool GC_should_trigger_collection = FALSE;
+STATIC GC_bool GC_should_start_incremental_collection = FALSE;
-GC_API void GC_trigger_collection()
+GC_API void GC_start_incremental_collection()
{
- GC_should_trigger_collection = TRUE;
+ if (GC_incremental)
+ {
+ GC_should_start_incremental_collection = TRUE;
+ GC_collect_a_little();
+ }
}
/* Have we allocated enough to amortize a collection? */
@@ -382,9 +386,9 @@ GC_INNER GC_bool GC_should_collect(void)
last_gc_no = GC_gc_no;
last_min_bytes_allocd = min_bytes_allocd();
}
- if (GC_should_trigger_collection)
+ if (GC_should_start_incremental_collection)
{
- GC_should_trigger_collection = FALSE;
+ GC_should_start_incremental_collection = FALSE;
return TRUE;
}
return(GC_adj_bytes_allocd() >= last_min_bytes_allocd
diff --git a/include/gc.h b/include/gc.h
index 615e4961..3e79f03d 100644
--- a/include/gc.h
+++ b/include/gc.h
@@ -2034,7 +2034,7 @@ GC_API void GC_CALL GC_stop_world_external(void);
GC_API void GC_CALL GC_start_world_external(void);
GC_API void GC_CALL GC_disable_incremental(void);
-GC_API void GC_CALL GC_trigger_collection (void);
+GC_API void GC_CALL GC_start_incremental_collection (void);
/* APIs for getting access to raw GC heap */
/* These are NOT thread safe, so should be called with GC lock held */