src/cx/hash_map.h

changeset 1424
563033aa998c
parent 1318
12fa1d37fe48
equal deleted inserted replaced
1423:9a72258446cd 1424:563033aa998c
71 * 71 *
72 * If @p elem_size is #CX_STORE_POINTERS, the created map stores pointers instead of 72 * If @p elem_size is #CX_STORE_POINTERS, the created map stores pointers instead of
73 * copies of the added elements. 73 * copies of the added elements.
74 * 74 *
75 * @note Iterators provided by this hash map implementation provide the remove operation. 75 * @note Iterators provided by this hash map implementation provide the remove operation.
76 * The index value of an iterator is incremented when the iterator advanced without removal. 76 * The index value of an iterator is incremented when the iterator advanced without
77 * removing an entry.
77 * In other words, when the iterator is finished, @c index==size . 78 * In other words, when the iterator is finished, @c index==size .
78 * 79 *
79 * @param allocator the allocator to use 80 * @param allocator the allocator to use
80 * (if @c NULL, the cxDefaultAllocator will be used) 81 * (if @c NULL, the cxDefaultAllocator will be used)
81 * @param itemsize the size of one element 82 * @param itemsize the size of one element
97 * 98 *
98 * If @p elem_size is #CX_STORE_POINTERS, the created map stores pointers instead of 99 * If @p elem_size is #CX_STORE_POINTERS, the created map stores pointers instead of
99 * copies of the added elements. 100 * copies of the added elements.
100 * 101 *
101 * @note Iterators provided by this hash map implementation provide the remove operation. 102 * @note Iterators provided by this hash map implementation provide the remove operation.
102 * The index value of an iterator is incremented when the iterator advanced without removal. 103 * The index value of an iterator is incremented when the iterator advanced without
104 * removing an entry.
103 * In other words, when the iterator is finished, @c index==size . 105 * In other words, when the iterator is finished, @c index==size .
104 * 106 *
105 * @param itemsize (@c size_t) the size of one element 107 * @param itemsize (@c size_t) the size of one element
106 * @return (@c CxMap*) a pointer to the new hash map 108 * @return (@c CxMap*) a pointer to the new hash map
107 */ 109 */
109 111
110 /** 112 /**
111 * Increases the number of buckets, if necessary. 113 * Increases the number of buckets, if necessary.
112 * 114 *
113 * The load threshold is @c 0.75*buckets. If the element count exceeds the load 115 * The load threshold is @c 0.75*buckets. If the element count exceeds the load
114 * threshold, the map will be rehashed. Otherwise, no action is performed and 116 * threshold, the map will be rehashed. Otherwise, no action is performed, and
115 * this function simply returns 0. 117 * this function simply returns 0.
116 * 118 *
117 * The rehashing process ensures, that the number of buckets is at least 119 * The rehashing process ensures that the number of buckets is at least
118 * 2.5 times the element count. So there is enough room for additional 120 * 2.5 times the element count. So there is enough room for additional
119 * elements without the need of another soon rehashing. 121 * elements without the need of another soon rehashing.
120 * 122 *
121 * You can use this function after filling a map to increase access performance. 123 * You can use this function after filling a map to increase access performance.
122 * 124 *

mercurial