From e6a377dfd040377fbe1bfe4b71463d697ed9a8ed Mon Sep 17 00:00:00 2001 From: CPunch Date: Tue, 17 Nov 2020 14:39:02 -0600 Subject: [PATCH] added comments --- src/ctable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ctable.c b/src/ctable.c index 68bee99..a495fb4 100644 --- a/src/ctable.c +++ b/src/ctable.c @@ -109,13 +109,13 @@ static CTableEntry *findEntry(CTableEntry *entries, int mask, CValue key) { static void resizeTbl(CState *state, CTable *tbl, size_t newCapacity) { size_t size = sizeof(CTableEntry) * newCapacity; - cosmoM_checkGarbage(state, size); + cosmoM_checkGarbage(state, size); // if this allocation would cause a GC, run the GC // if count > 8 and active entries < tombstones if (tbl->count > MIN_TABLE_CAPACITY && tbl->count - tbl->tombstones < tbl->tombstones) { int tombs = tbl->tombstones; tbl->tombstones = 0; // set this to 0 so in our recursive call to resizeTbl() this branch isn't run again - resizeTbl(state, tbl, nextPow2((tbl->count - tombs)) * GROW_FACTOR); + resizeTbl(state, tbl, nextPow2((tbl->count - tombs) * GROW_FACTOR)); // shrink based on active entries to the next pow of 2 cosmoM_updateThreshhold(state); // force a threshhold update since this *could* be such a huge memory difference return; }