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),
"HT_SLOTS_PER_CHUNK too high to fit into nalloc");
16#define HT_IDXENT_SZ (sizeof(uint32))
17#define HT_IDXENTWITHMETA_SZ (HT_IDXENT_SZ + sizeof(uint8))
18#define HT_SLOT_CHUNK(slot) ((slot) >> HT_CHUNK_SHIFT)
19#define HT_SLOT_KEY_CHUNK_PTR(hdr, slot) ((uintptr)hdr->keystorage[HT_SLOT_CHUNK(slot)])
20#define HT_SLOT_VAL_CHUNK_PTR(hdr, slot) ((uintptr)hdr->valstorage[HT_SLOT_CHUNK(slot)])
21#define HT_SLOT_OFF(slot, elemsz) ((uintptr)((slot) & HT_CHUNK_MASK) * elemsz)
22#define HT_SLOT_KEY_PTR(hdr, slot) ((void*)(HT_SLOT_KEY_CHUNK_PTR(hdr, slot) + (size_t)((slot) & HT_CHUNK_MASK) * stGetSize(hdr->keytype)))
23#define HT_SLOT_VAL_PTR(hdr, slot) ((void*)(HT_SLOT_VAL_CHUNK_PTR(hdr, slot) + (size_t)((slot) & HT_CHUNK_MASK) * stGetSize(hdr->valtype)))
25#define HT_METADATA(hdr) ((uint8*)(&hdr->index[hdr->idxsz]))
27#define HT_DELETED_IDX(slot) ((slot & HT_CHUNK_MASK) >> 3)
28#define HT_DELETED_BIT(slot) (1 << (slot & 7))
30#define HT_SMALLHDR_OFFSET (offsetof(HashTableHeader, idxsz))
31#define HDRKEYOPS(hdr) ((hdr->flags & HTINT_Extended) ? &hdr->keytypeops : NULL)
32#define HDRVALOPS(hdr) ((hdr->flags & HTINT_Extended) ? &hdr->valtypeops : NULL)
34#define hashIndexDeleted (0xffffffffUL)
35#define hashIndexEmpty (0UL)
37uint32 _htNextSlot(_Inout_ HashTableHeader *hdr, uint32 slot);
Hash table container with type-safe generic key-value storage.
Other miscellaneous utilities.