diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-07-06 10:18:50 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-07-06 10:18:50 -0400 | 
| commit | 8b52179d2ae6eecad2155fb04ec99610077618f9 (patch) | |
| tree | 2f9eabf41369731cd4a71a33bcff00f481254919 /lib/hash.h | |
| parent | df66eb2eeb7189ab27be49aa8637938cdcf43cb6 (diff) | |
lib: Add some documentation
Add some documentation to hash_walk/iterate to tell people
to not do something stupid.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/hash.h')
| -rw-r--r-- | lib/hash.h | 8 | 
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/hash.h b/lib/hash.h index c7e670b723..12c214e469 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -232,7 +232,9 @@ extern void *hash_release(struct hash *hash, void *data);   * Iterate over the elements in a hash table.   *   * It is safe to delete items passed to the iteration function from the hash - * table during iteration. + * table during iteration.  Please note that adding entries to the hash + * during the walk will cause undefined behavior in that some new entries + * will be walked and some will not.  So do not do this.   *   * hash   *    hash table to operate on @@ -250,7 +252,9 @@ extern void hash_iterate(struct hash *hash,   * Iterate over the elements in a hash table, stopping on condition.   *   * It is safe to delete items passed to the iteration function from the hash - * table during iteration. + * table during iteration.  Please note that adding entries to the hash + * during the walk will cause undefined behavior in that some new entries + * will be walked and some will not.  So do not do this.   *   * hash   *    hash table to operate on  | 
