News for hackers. Stuff that matters.
Re:15-line hash table in C by jakobegger on Friday December 12, 2014 @03:22AM (#8739032)
For those of us who actually ship code, I'd like to suggest khash[1], which is a pretty nice implementation of a hash table in C. It uses lot's of macros, so if you're looking for a brain teaser you will be satisfied as well :)

[1]: http://attractivechaos.github.io/klib/#Khash%3A%20generic%20...

Re:15-line hash table in C by AntiRush on Friday December 12, 2014 @03:43AM (#8739096)
uthash[1] is another good solution. It's pretty bulletproof and has lots of options. Also implemented with macros, if that's a plus :-).

[1]: http://troydhanson.github.io/uthash/

Re:15-line hash table in C by gjulianm on Friday December 12, 2014 @09:34AM (#8740161)
I don't think being implemented with macros is a plus. I've seen some friends use it and get stuck whenever it was failing because it's impossible to know how it's working. It's the same type of cleverness some people criticize in other comments. Yes, it may be complete and useful but it's opaque.
Re:15-line hash table in C by cel on Friday December 12, 2014 @10:58AM (#8740748)
See also clibs/hash[1], which provides a friendly API on top of khash.

[1]: https://github.com/clibs/hash