summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-08-10 11:55:31 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-08-10 11:55:31 -0700
commit33481c1e59fa557553052912a005094aaf913074 (patch)
tree343c002106d988930ff9347ca27feb9d3843fe9b
parentMerge branch 'js/nedmalloc-gcc6-warnings' into maint (diff)
parenthashmap: clarify that hashmap_entry can safely be discarded (diff)
downloadtgif-33481c1e59fa557553052912a005094aaf913074.tar.xz
Merge branch 'jc/hashmap-doc-init' into maint
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
-rw-r--r--Documentation/technical/api-hashmap.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/technical/api-hashmap.txt b/Documentation/technical/api-hashmap.txt
index ad7a5bddd2..28f5a8b715 100644
--- a/Documentation/technical/api-hashmap.txt
+++ b/Documentation/technical/api-hashmap.txt
@@ -104,6 +104,11 @@ If `free_entries` is true, each hashmap_entry in the map is freed as well
`entry` points to the entry to initialize.
+
`hash` is the hash code of the entry.
++
+The hashmap_entry structure does not hold references to external resources,
+and it is safe to just discard it once you are done with it (i.e. if
+your structure was allocated with xmalloc(), you can just free(3) it,
+and if it is on stack, you can just let it go out of scope).
`void *hashmap_get(const struct hashmap *map, const void *key, const void *keydata)`::