Skip to content
/ hs_hash Public

A C based implementation of a Hopscotch hash table

License

Notifications You must be signed in to change notification settings

gatzka/hs_hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hs_hash

A C based implementation of a Hopscotch hash table.

This is an C-based implementation of the hopscotch hashtable alrgorithm.

The implementation is focused to be used in small microcontroller based systems or the Linux kernel. Resizing of the hashmap is not implemented, so you can't change the size after declaring the hashtable.

One of the major advantages is that you can make HS_HASHTABLE_GET operations ans concurrently HS_HASHTABLE_REMOVE and HS_HASHTABLE_PUT operations, so the GET operation might be interrupted by PUT and/or REMOVE.

Three different key types are supported:

  • uint32_t
  • uint64_t
  • zero terminated strings (char *)

To avoid code duplication and because C has no template engine, the whole implementation is a basically a big macro. So don't expect good debug experience if you step into this code and be prepared for strange and nasty compiler warnings/errors if you don't use the hashtable correctly.

About

A C based implementation of a Hopscotch hash table

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published