add cxHashMapCreateSimple()

Sat, 22 Apr 2023 12:29:00 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 22 Apr 2023 12:29:00 +0200
changeset 696
1ba4ec2e7a89
parent 695
eb1884a8b096
child 697
ebdce4bf262b

add cxHashMapCreateSimple()

src/cx/hash_map.h file | annotate | diff | comparison | revisions
--- a/src/cx/hash_map.h	Sat Apr 22 12:16:34 2023 +0200
+++ b/src/cx/hash_map.h	Sat Apr 22 12:29:00 2023 +0200
@@ -90,6 +90,22 @@
 );
 
 /**
+ * Creates a new hash map with a default number of buckets.
+ *
+ * If \p item_size is CX_STORE_POINTERS, the created map will be created as if
+ * cxMapStorePointers() was called immediately after creation.
+ *
+ * @note Iterators provided by this hash map implementation provide the remove operation.
+ * The index value of an iterator is the incremented when the iterator advanced without removal.
+ * In other words, when the iterator is finished, \c index==size .
+ *
+ * @param itemsize the size of one element
+ * @return a pointer to the new hash map
+ */
+#define cxHashMapCreateSimple(itemsize) \
+    cxHashMapCreate(cxDefaultAllocator, itemsize, 0)
+
+/**
  * Increases the number of buckets, if necessary.
  *
  * The load threshold is \c 0.75*buckets. If the element count exceeds the load

mercurial