6typedef struct HTChunkInfo {
7 uint8 deleted[HT_SLOTS_PER_CHUNK >> 3];
12#define HT_METADATA_THRESHOLD 256
14_Static_assert((HT_SLOTS_PER_CHUNK >> 8) <
sizeof(((HTChunkInfo*)0)->nalloc),
15 "HT_SLOTS_PER_CHUNK too high to fit into nalloc");
17#define HT_IDXENT_SZ (sizeof(uint32))
18#define HT_IDXENTWITHMETA_SZ (HT_IDXENT_SZ + sizeof(uint8))
19#define HT_SLOT_CHUNK(slot) ((slot) >> HT_CHUNK_SHIFT)
20#define HT_SLOT_KEY_CHUNK_PTR(hdr, slot) ((uintptr)hdr->keystorage[HT_SLOT_CHUNK(slot)])
21#define HT_SLOT_VAL_CHUNK_PTR(hdr, slot) ((uintptr)hdr->valstorage[HT_SLOT_CHUNK(slot)])
22#define HT_SLOT_OFF(slot, elemsz) ((uintptr)((slot) & HT_CHUNK_MASK) * elemsz)
23#define HT_SLOT_KEY_PTR(hdr, slot) \
24 ((void*)(HT_SLOT_KEY_CHUNK_PTR(hdr, slot) + \
25 (size_t)((slot) & HT_CHUNK_MASK) * stGetSize(hdr->keytype)))
26#define HT_SLOT_VAL_PTR(hdr, slot) \
27 ((void*)(HT_SLOT_VAL_CHUNK_PTR(hdr, slot) + \
28 (size_t)((slot) & HT_CHUNK_MASK) * stGetSize(hdr->valtype)))
36#define HT_CHUNK_COUNT(hdr) (HT_SLOT_CHUNK((hdr)->storused) + 1)
38#define HT_METADATA(hdr) ((uint8*)(&hdr->index[hdr->idxsz]))
40#define HT_DELETED_IDX(slot) ((slot & HT_CHUNK_MASK) >> 3)
41#define HT_DELETED_BIT(slot) (1 << (slot & 7))
43#define hashIndexDeleted (0xffffffffUL)
44#define hashIndexEmpty (0UL)
46uint32 _htNextSlot(_Inout_ HashTableHeader* hdr, uint32 slot);
Hash table container with type-safe generic key-value storage.
Other miscellaneous utilities.