mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 08:10:05 +00:00
shrink based on count
This commit is contained in:
parent
7182f5ccd1
commit
c1854bdcf1
@ -115,7 +115,7 @@ static void resizeTbl(CState *state, CTable *tbl, size_t newCapacity) {
|
|||||||
if (tbl->count > MIN_TABLE_CAPACITY && tbl->count - tbl->tombstones < tbl->tombstones) {
|
if (tbl->count > MIN_TABLE_CAPACITY && tbl->count - tbl->tombstones < tbl->tombstones) {
|
||||||
int tombs = 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
|
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->capacity - tombs) * GROW_FACTOR));
|
resizeTbl(state, tbl, nextPow2((tbl->count - tombs)) * GROW_FACTOR);
|
||||||
cosmoM_updateThreshhold(state); // force a threshhold update since this *could* be such a huge memory difference
|
cosmoM_updateThreshhold(state); // force a threshhold update since this *could* be such a huge memory difference
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user