summaryrefslogtreecommitdiff
path: root/Documentation/technical
diff options
context:
space:
mode:
authorKarsten Blees <karsten.blees@gmail.com>2014-07-02 22:21:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-07-07 20:56:31 (GMT)
commitaa420c48eaea5c89946b8753363d09955300133f (patch)
tree0b51dd2061ed644b590320babd613273c74153e4 /Documentation/technical
parent039dc71a7cb824300e242f8abc0fcb19dac93641 (diff)
downloadgit-aa420c48eaea5c89946b8753363d09955300133f.zip
git-aa420c48eaea5c89946b8753363d09955300133f.tar.gz
git-aa420c48eaea5c89946b8753363d09955300133f.tar.bz2
hashmap: improve struct hashmap member documentation
Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/technical')
-rw-r--r--Documentation/technical/api-hashmap.txt16
1 files changed, 12 insertions, 4 deletions
diff --git a/Documentation/technical/api-hashmap.txt b/Documentation/technical/api-hashmap.txt
index 37727cd..f07f17d 100644
--- a/Documentation/technical/api-hashmap.txt
+++ b/Documentation/technical/api-hashmap.txt
@@ -8,11 +8,19 @@ Data Structures
`struct hashmap`::
- The hash table structure.
+ The hash table structure. Members can be used as follows, but should
+ not be modified directly:
+
-The `size` member keeps track of the total number of entries. The `cmpfn`
-member is a function used to compare two entries for equality. The `table` and
-`tablesize` members store the hash table and its size, respectively.
+The `size` member keeps track of the total number of entries (0 means the
+hashmap is empty).
++
+`tablesize` is the allocated size of the hash table. A non-0 value indicates
+that the hashmap is initialized. It may also be useful for statistical purposes
+(i.e. `size / tablesize` is the current load factor).
++
+`cmpfn` stores the comparison function specified in `hashmap_init()`. In
+advanced scenarios, it may be useful to change this, e.g. to switch between
+case-sensitive and case-insensitive lookup.
`struct hashmap_entry`::