libwebsockets
Lightweight C library for HTML5 websockets
generic map apis

Generic map structures and apis

lws_map

Discrete owner object represents the whole map, created with key-specific ops for hashing the key to a uint32_t and comparing two keys. Owns a list of hash tables whose size / modulo it set at creation time.

Items in the map are contained in a lws_map_item_t that is indexed in a hash table.

It's difficult to make a single compact map abstraction that fits all cases, this is useful to the extent you have the memory to trade off the number of hashtables needed for the amount of items and the lookup latency limit for your application, typically for hundreds or low thousands of items.