diff options
author | jonas echterhoff <jonas@unity3d.com> | 2019-02-22 10:50:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-22 10:50:06 +0300 |
commit | b0946d3609e28bdc00633174c89e8985cec6dc03 (patch) | |
tree | e17e4c8557f8c1974d3e66cf1387eefc6c71e348 | |
parent | b4cd6947650f22c610c0891d87a49396109a7114 (diff) | |
parent | 66a32ac3cf28ffb79a9aa8f2df1a2a0a9dfb660c (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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |