#pragma once typedef struct sl_htable sl_htable; enum { HT_N_INLINE = 32, HT_N_INLINE_PAIRS = HT_N_INLINE/2, }; struct sl_htable { void **table; usize size; usize num; usize live; // FIXME(sigrid): to skip over non-items in for-each // put it on the stack instead? usize i; void *local[HT_N_INLINE]; }sl_aligned(8); // define this to be an invalid key/value #define HT_NOTFOUND ((void*)-1) // initialize and free sl_htable *htable_new(sl_htable *h, usize numpairs) sl_nonnull(1); void htable_free(sl_htable *h); // clear and (possibly) change size void htable_reset(sl_htable *h, usize sz) sl_nonnull(1);