diff options
author | florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2014-09-13 22:31:13 +0000 |
---|---|---|
committer | florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2014-09-13 22:31:13 +0000 |
commit | 9c39f5128fd3e00a7f7b0c244ff083cab31a5eb5 (patch) | |
tree | 6538d4ccb0183f5ae21e70122631b380e1688b61 /include/pub_tool_hashtable.h | |
parent | b49e4a5087d1927179baf1dea9dcc658fd778348 (diff) | |
download | valgrind-9c39f5128fd3e00a7f7b0c244ff083cab31a5eb5.tar.gz |
Document the NULL-ness of the return values of HT_construct and HT_to_array.
Audit call sites.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14532 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, 3 insertions, 2 deletions
diff --git a/include/pub_tool_hashtable.h b/include/pub_tool_hashtable.h index d640c39e4..21dd0b234 100644 --- a/include/pub_tool_hashtable.h +++ b/include/pub_tool_hashtable.h @@ -54,7 +54,7 @@ typedef struct _VgHashTable * VgHashTable; /* Make a new table. Allocates the memory with VG_(calloc)(), so can be freed with VG_(free)(). The table starts small but will periodically be expanded. This is transparent to the users of this - module. */ + module. The function never returns NULL. */ extern VgHashTable VG_(HT_construct) ( const HChar* name ); /* Count the number of nodes in a table. */ @@ -95,7 +95,8 @@ extern void VG_(HT_print_stats) ( VgHashTable table, HT_Cmp_t cmp ); /* Allocates a suitably-sized array, copies pointers to all the hashtable elements into it, then returns both the array and the size of it. The - array must be freed with VG_(free). */ + array must be freed with VG_(free). If the hashtable is empty, the + function returns NULL and assigns *nelems = 0. */ extern VgHashNode** VG_(HT_to_array) ( VgHashTable t, /*OUT*/ UInt* n_elems ); /* Reset the table's iterator to point to the first element. */ |