]> git.ipfire.org Git - thirdparty/systemd.git/commit
basic/hashmap: add hashops variant that does strdup/freeing on its own
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 11 Apr 2019 16:08:57 +0000 (18:08 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Jul 2019 14:50:36 +0000 (16:50 +0200)
commit87da87846dbfb07358d01f9d53f1c35ec61b447d
tree1568e43f10f8f8526e4e73adcf492eccb8b31df8
parent0bf2c5e5ec1b756e95f0e0792bfa473b2e140a64
basic/hashmap: add hashops variant that does strdup/freeing on its own

So far, we'd use hashmap_free_free to free both keys and values along with
the hashmap. I think it's better to make this more encapsulated: in this variant
the way contents are freed can be decided when the hashmap is created, and
users of the hashmap can always use hashmap_free.
src/basic/hash-funcs.c
src/basic/hash-funcs.h
src/basic/hashmap.c
src/basic/hashmap.h
src/test/test-hashmap-plain.c