fix more GC bugs

This commit is contained in:
2023-08-29 23:21:52 -05:00
committed by cpunch
parent d41126e75f
commit 6a47c82179
10 changed files with 57 additions and 47 deletions

View File

@@ -61,7 +61,7 @@ void cosmoT_addTable(CState *state, CTable *from, CTable *to)
void cosmoT_clearTable(CState *state, CTable *tbl)
{
cosmoM_freearray(state, CTableEntry, tbl->table, cosmoT_getCapacity(tbl));
cosmoM_freeArray(state, CTableEntry, tbl->table, cosmoT_getCapacity(tbl));
}
static uint32_t getObjectHash(CObj *obj)
@@ -165,7 +165,7 @@ static void resizeTbl(CState *state, CTable *tbl, int newCapacity, bool canShrin
}
// free the old table
cosmoM_freearray(state, CTableEntry, tbl->table, oldCap);
cosmoM_freeArray(state, CTableEntry, tbl->table, oldCap);
tbl->table = entries;
tbl->capacityMask = newCapacity - 1;