uthash
smol_world
uthash | smol_world | |
---|---|---|
4 | 3 | |
3,936 | 80 | |
- | - | |
2.3 | 1.5 | |
4 months ago | 12 months ago | |
C | C++ | |
GNU General Public License v3.0 or later | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
uthash
- A simple hash table in C
-
Please critque the hashtable that is now fixed and works.
You should check out uthash, which has an extensive test suite and documentation (the user guide), to see how a library like this one that's used in the real world is written, tested, and used: https://github.com/troydhanson/uthash/tree/master/tests
-
Hacker News top posts: Mar 26, 2022
Uthash – C macros for hash tables and more\ (16 comments)
- Uthash – C macros for hash tables and more
smol_world
-
A simple hash table in C
Thank you for this article.
I have been working on trying to design a contiguous hash table data structure that has these two mutual requirements:
a) allows deep clones (due to contiguous memory copyable with memcpy)
b) supports arbitrarily nestable hashmaps
The closest library I know about is smolworld ( https://github.com/snej/smol_world ) but I don't know how easy it can be cloned.
These requirements rules out multiple mallocs: I do one single malloc and expect that to be enough for the entire hashmap.
I'm not sure if these constraints might also force a fixed number of buckets and a fixed capacity.
The clonable property requires interior mutability be limited, because if you memcpy pointers they would cause structure sharing, that I'm trying to avoid, hence a deep clone.
Rationale: these are the use cases I have for such a data structure. The first is cheap copy on write. I also have a left-right concurrency hashmap, but I feel the properties of this data structure are even better. The first is a sharding in multithreading design: do a cheap memcpy for each thread and shard the processing and merge at the end, without any synchronization cost while the threads are working. I know that deep cloning is slow in Java if you do it with loops rather than memcpy. Another use case is efficient serialization.
- Smol_world: Compact garbage-collected heap and JSON-like object model
What are some alternatives?
CVE-2022-27254 - PoC for vulnerability in Honda's Remote Keyless System(CVE-2022-27254)
sc - Common libraries and data structures for C.
frr - The FRRouting Protocol Suite
Klib - A standalone and lightweight C library
map - A type-safe hash map implementation for C
QEMU - Official QEMU mirror. Please see https://www.qemu.org/contribute/ for how to submit changes to QEMU. Pull Requests are ignored. Please only use release tarballs from the QEMU website.
ctl - My variant of the C Template Library
librdkafka - The Apache Kafka C/C++ library
swiss-table - C adaptation of the swiss table (flat hash map) presented at CppCon by Google (https://www.youtube.com/watch?v=ncHmEUmJZf4).