Commit Graph

6 Commits

Author SHA1 Message Date
Daniel Silverstone
b6d33785a0
hashmap: Fix a whitespace bogon
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 10:28:41 +00:00
Michael Drake
a59646cbf8 Hashmap: Check for failure of first malloc. 2020-02-24 08:23:45 +00:00
Daniel Silverstone
088917641f
utils: Add hashmap_count()
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 20:59:40 +00:00
Daniel Silverstone
3e02961ec8
utils: Fix destroy of non-empty hashmap
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 20:59:40 +00:00
Daniel Silverstone
54b1960d18
utils: Add iteration API to hashmap
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 20:59:39 +00:00
Daniel Silverstone
a653e1e86e
utils: Add a generic hashmap and tests for it
In order to be able to use a generic hashmap in things such
as the fs_backing_store we want one to exist.  Here it is,
along with some moderately comprehensive tests.

Current limits:

1. All keys and values are owned by the hashmap
2. The hashmap, while capable of different bucket counts
   only has a single fixed count for now

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 15:13:47 +00:00