Skip to content

Commit 2eb946a

Browse files
committed
Merge branch 'jc/hashmap-doc-init' into next
The API documentation for hashmap was unclear if hashmap_entry can be safely discarded without any other consideration. State that it is safe to do so. * jc/hashmap-doc-init: hashmap: clarify that hashmap_entry can safely be discarded
2 parents dc1c9bb + 54ba5a1 commit 2eb946a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Documentation/technical/api-hashmap.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ If `free_entries` is true, each hashmap_entry in the map is freed as well
104104
`entry` points to the entry to initialize.
105105
+
106106
`hash` is the hash code of the entry.
107+
+
108+
The hashmap_entry structure does not hold references to external resources,
109+
and it is safe to just discard it once you are done with it (i.e. if
110+
your structure was allocated with xmalloc(), you can just free(3) it,
111+
and if it is on stack, you can just let it go out of scope).
107112

108113
`void *hashmap_get(const struct hashmap *map, const void *key, const void *keydata)`::
109114

0 commit comments

Comments
 (0)