summaryrefslogtreecommitdiff
path: root/Documentation/technical
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-08 21:48:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-08 21:48:45 (GMT)
commit16f0cb2dd86aeded6a693db3a9881e43c4f95087 (patch)
treecb67a34cfd7273e43820b71ba8314cefccf0c598 /Documentation/technical
parent43a42aa40303b2b5a3fdd04a04ce4f8d015d14eb (diff)
parent54ba5a1a16c0306bda1c304a341b9e4e7ab44684 (diff)
downloadgit-16f0cb2dd86aeded6a693db3a9881e43c4f95087.zip
git-16f0cb2dd86aeded6a693db3a9881e43c4f95087.tar.gz
git-16f0cb2dd86aeded6a693db3a9881e43c4f95087.tar.bz2
Merge branch 'jc/hashmap-doc-init'
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
Diffstat (limited to 'Documentation/technical')
-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 ad7a5bd..28f5a8b 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)`::