diff options
Diffstat (limited to 'include/std')
-rw-r--r-- | include/std/hash_map.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/std/hash_map.h b/include/std/hash_map.h index d789db4..c9e5b51 100644 --- a/include/std/hash_map.h +++ b/include/std/hash_map.h @@ -25,15 +25,17 @@ struct HashMap { CHECK_RESULT int hash_map_init(HashMap *self, ArenaAllocator *allocator, usize value_type_size, HashMapCompare key_compare_func, HashMapHash key_hash_func); /* -Not thread-safe. -Expected @value size to be @self->value_type_size. + Not thread-safe. + Expected @value size to be @self->value_type_size. */ CHECK_RESULT int hash_map_insert(HashMap *self, BufferView key, void *value); /* -Thread-safe unless @hash_map_insert is used in another thread at the same time. -Expected @value size to be @self->value_type_size. + Thread-safe unless @hash_map_insert is used in another thread at the same time. + Expected @value size to be @self->value_type_size. + If @value is NULL, then the value is not copied and the functions works the same as @hash_map_contains */ CHECK_RESULT bool hash_map_get(HashMap *self, BufferView key, void *value); +CHECK_RESULT bool hash_map_contains(HashMap *self, BufferView key); int hash_map_compare_string(const void *a, const void *b); |