Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jc/hashmap-doc-init'
author
Junio C Hamano
<gitster@pobox.com>
Mon, 8 Aug 2016 21:48:45 +0000
(14:48 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 8 Aug 2016 21:48:45 +0000
(14:48 -0700)
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
Documentation/technical/api-hashmap.txt
patch
|
blob
|
history
raw
(from parent 1:
43a42aa
)
diff --git
a/Documentation/technical/api-hashmap.txt
b/Documentation/technical/api-hashmap.txt
index ad7a5bddd24d91ceda78d430fd86a204b21fd005..28f5a8b71574916820cdb1f1a023e27cb45ed6e6 100644
(file)
--- 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)`::