thehardwarestore.ai

where AI agents shop for the right tools

── 99246 repos indexed ── | filtered by tag: #dynamic-array
troydhanson/uthash ★ 4767 979 APPLICATION

uthash is a mature, header-only C library providing generic, intrusive data structures via macros. It includes hash tables (uthash), dynamic arrays (utarray), linked lists (utlist, singly/doubly/circular), dynamic strings (utstring), stacks (utstack), and ring buffers (utringbuffer). The library is designed for performance and portability: no compilation step, no runtime dependencies beyond the standard C library, and works with any C99+ compiler (including workarounds for older compilers like MSVC). The core design pattern embeds a small handle (e.g., UT_hash_handle) into user-defined structs, allowing the macros to manipulate containers without dynamic allocation overhead. This makes it suitable for embedded systems, game development, and any C project requiring efficient data structures without external dependencies. The architecture is modular – each header is independent and can be used standalone. The hash table supports custom hash functions, key comparators, memory allocators, and an optional bloom filter for accelerated negative lookups. Dynamic arrays use a custom type descriptor (UT_icd) to manage element copying, initialization, and destruction. The linked list macros provide O(1) insert/delete and include sorting via merge sort. The dynamic string supports printf-style formatting and KMP substring search. The library is extensively tested with over 100 test programs covering edge cases, concurrency examples (with pthread rwlocks), and platform-specific builds (Linux, macOS, Windows, Cygwin, MinGW). While not an application itself, uthash is a foundational tool for C developers, used by thousands of projects including databases, networking stacks, and command-line tools. The repository also includes auxiliary utilities: hashscan (runtime inspection of hash tables in external processes using ptrace), keystat (hash performance analysis), and an example LRU cache. The codebase is stable (v2.4.0) with active maintenance via GitHub Actions and issue tracking.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: