diff options
author | philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2015-05-20 15:08:09 +0000 |
---|---|---|
committer | philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2015-05-20 15:08:09 +0000 |
commit | e437427c93a605ac907137b3307f1f63a1462524 (patch) | |
tree | f7380105ab9a8c1a399a75a73aab776d13b9f43e /include/pub_tool_hashtable.h | |
parent | 3743c91f664a62d42ffc337e5d447d5b21554ee8 (diff) | |
download | valgrind-e437427c93a605ac907137b3307f1f63a1462524.tar.gz |
Have the hash table 'gen' functions comparing the key instead of the
cmp function.
Document this in the cmp function comment in pub_tool_hashtable.h
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15263 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'include/pub_tool_hashtable.h')
-rw-r--r-- | include/pub_tool_hashtable.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/pub_tool_hashtable.h b/include/pub_tool_hashtable.h index b105ac404..6fc6822b4 100644 --- a/include/pub_tool_hashtable.h +++ b/include/pub_tool_hashtable.h @@ -84,7 +84,10 @@ typedef Word (*HT_Cmp_t) ( const void* node1, const void* node2 ); * when comparing the rest of the node, if the node data contains holes between components, either the node memory should be fully initialised (e.g. allocated using VG_(calloc)) or each component should be compared - individually. */ + individually. + Note that the cmp function is only called for elements that already + have keys that are equal. So, it is not needed for cmp to check for + key equality. */ extern void* VG_(HT_gen_lookup) ( const VgHashTable *table, const void* node, HT_Cmp_t cmp ); extern void* VG_(HT_gen_remove) ( VgHashTable *table, const void* node, |