minor CTable refactoring

This commit is contained in:
2023-08-25 19:57:16 -05:00
committed by cpunch
parent f76f2ffa92
commit 7c5d2f6b65
6 changed files with 55 additions and 31 deletions

View File

@@ -18,9 +18,12 @@ typedef struct CTable
int count;
int capacityMask; // +1 to get the capacity
int tombstones;
int tombThreshold;
CTableEntry *table;
} CTable;
#define cosmoT_getCapacity(tbl) ((tbl)->capacityMask + 1)
COSMO_API void cosmoT_initTable(CState *state, CTable *tbl, int startCap);
COSMO_API void cosmoT_clearTable(CState *state, CTable *tbl);
COSMO_API int cosmoT_count(CTable *tbl);