troydhanson/uthash
FreeC macros for hash tables and more
FreeFree tier
About troydhanson/uthash
uthash is a collection of C macros that implement hash tables, linked lists, dynamic arrays, and string handling. It is header-only, with no external dependencies, making it easy to integrate into any C project. The library is widely used in embedded systems and other performance-sensitive applications.
Key Features
Implements hash tables using C macros
Provides linked list macros (utlist)
Dynamic array macros (utarray)
String handling macros (utstring)
Header-only, no compilation needed
No external dependencies
Lightweight and fast
Cross-platform
Pros & Cons
Pros
- Header-only, easy to add to any project
- No external dependencies
- Very fast performance
- Supports multiple data structures
- Widely adopted and well-tested
Cons
- Macros can lead to hard-to-debug errors
- Limited type safety compared to templates
- No built-in thread safety
- Not suitable for C++ projects preferring STL
Best For
Embedded systems programmingGame developmentSystem programming in CProjects requiring lightweight data structures
FAQ
What is uthash?
uthash is a collection of C macros for hash tables, linked lists, dynamic arrays, and string handling. It is header-only and requires no external libraries.
How do I install uthash?
Simply copy the header files to your project and include them. No compilation or linking needed.