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; }