diff options
author | Jonas Echterhoff <jonas@unity3d.com> | 2020-05-26 11:19:25 +0300 |
---|---|---|
committer | Jonas Echterhoff <jonas@unity3d.com> | 2020-05-26 11:19:25 +0300 |
commit | 0480a661fed6149741aeb318f8aa31a96d9182cb (patch) | |
tree | 9ddd2684c5de680be2f4268f4d26446de8863f40 | |
parent | 7027029e20978c23787d5801d9098016e51133c3 (diff) |
Change name; also start collection
-rw-r--r-- | alloc.c | 14 | ||||
-rw-r--r-- | include/gc.h | 2 |
2 files changed, 10 insertions, 6 deletions
@@ -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 */ |