summaryrefslogtreecommitdiff
path: root/src/basic/hashmap.c
AgeCommit message (Collapse)Author
2015-06-18Merge pull request #294 from teg/hashmap-debug-locking-2David Herrmann
hashmap: debug - lock access to the global hashmap list
2015-06-18hashmap: debug - lock access to the global hashmap listTom Gundersen
This may be used from multi-threaded programs (say through nss-resolve), so we must protect the global list. This is still only relevant for debug builds, so we do not try to handle cases where the locking fail, but simply assert.
2015-06-17hashmap: allow NULL key in ordered_hashmap_next()Michal Schmidt
There is no reason to require key to be non-NULL. Change test_ordered_hashmap_next() to use trivial_hash_ops in order to test NULL key too.
2015-06-14hashmap: fix iterators to not skip entriesDavid Herrmann
Currently, the HASHMAP iterators stop at the first NULL entry in a hashmap. This is non-obvious and breaks users like sd-device, which legitimately store NULL values in a hashmap. Fix all the iterators by taking a pointer to the value storage, instead of returning it. The iterators now return a boolean that tells whether the end of the list was reached. Current users of HASHMAP_FOREACH() are *NOT* changed to explicitly check for NULL. If it turns out, there were users that inserted NULL into hashmaps, but didn't properly check for it during iteration, then we really want to find those and fix them.
2015-06-11build-sys: split internal basic/ library from shared/Kay Sievers
basic/ can be used by everything cannot use anything outside of basic/ libsystemd/ can use basic/ cannot use shared/ shared/ can use libsystemd/