79 * @param allocator the allocator to use |
79 * @param allocator the allocator to use |
80 * @param itemsize the size of one element |
80 * @param itemsize the size of one element |
81 * @param buckets the initial number of buckets in this hash map |
81 * @param buckets the initial number of buckets in this hash map |
82 * @return a pointer to the new hash map |
82 * @return a pointer to the new hash map |
83 */ |
83 */ |
84 __attribute__((__nonnull__, __warn_unused_result__)) |
84 cx_attr_nonnull |
|
85 cx_attr_nodiscard |
|
86 cx_attr_malloc |
|
87 cx_attr_dealloc(cxMapDestroy, 1) |
85 CxMap *cxHashMapCreate( |
88 CxMap *cxHashMapCreate( |
86 const CxAllocator *allocator, |
89 const CxAllocator *allocator, |
87 size_t itemsize, |
90 size_t itemsize, |
88 size_t buckets |
91 size_t buckets |
89 ); |
92 ); |
120 * @note If the specified map is not a hash map, the behavior is undefined. |
123 * @note If the specified map is not a hash map, the behavior is undefined. |
121 * |
124 * |
122 * @param map the map to rehash |
125 * @param map the map to rehash |
123 * @return zero on success, non-zero if a memory allocation error occurred |
126 * @return zero on success, non-zero if a memory allocation error occurred |
124 */ |
127 */ |
125 __attribute__((__nonnull__)) |
128 cx_attr_nonnull |
126 int cxMapRehash(CxMap *map); |
129 int cxMapRehash(CxMap *map); |
127 |
130 |
128 |
131 |
129 #ifdef __cplusplus |
132 #ifdef __cplusplus |
130 } // extern "C" |
133 } // extern "C" |