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>2019-02-22 10:50:06 +0300
committerGitHub <noreply@github.com>2019-02-22 10:50:06 +0300
commitb0946d3609e28bdc00633174c89e8985cec6dc03 (patch)
treee17e4c8557f8c1974d3e66cf1387eefc6c71e348
parentb4cd6947650f22c610c0891d87a49396109a7114 (diff)
parent66a32ac3cf28ffb79a9aa8f2df1a2a0a9dfb660c (diff)
Merge pull request #37 from Unity-Technologies/avoid-full-gc-in-table-grow
Avoid triggering a full GC when growing finalizer tables if in incremental mode
-rw-r--r--finalize.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/finalize.c b/finalize.c
index c73febe0..013f82b4 100644
--- a/finalize.c
+++ b/finalize.c
@@ -124,7 +124,9 @@ STATIC void GC_grow_table(struct hash_chain_entry ***table,
GC_ASSERT(I_HOLD_LOCK());
/* Avoid growing the table in case of at least 25% of entries can */
/* be deleted by enforcing a collection. Ignored for small tables. */
- if (log_old_size >= GC_ON_GROW_LOG_SIZE_MIN) {
+ /* In incremental mode we skip this optimization, as we want to */
+ /* avoid triggering a full GC whenever possible. */
+ if (log_old_size >= GC_ON_GROW_LOG_SIZE_MIN && !GC_incremental) {
IF_CANCEL(int cancel_state;)
DISABLE_CANCEL(cancel_state);