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
     1.1 --- a/src/cx/hash_map.h	Sat Apr 22 12:16:34 2023 +0200
     1.2 +++ b/src/cx/hash_map.h	Sat Apr 22 12:29:00 2023 +0200
     1.3 @@ -90,6 +90,22 @@
     1.4  );
     1.5  
     1.6  /**
     1.7 + * Creates a new hash map with a default number of buckets.
     1.8 + *
     1.9 + * If \p item_size is CX_STORE_POINTERS, the created map will be created as if
    1.10 + * cxMapStorePointers() was called immediately after creation.
    1.11 + *
    1.12 + * @note Iterators provided by this hash map implementation provide the remove operation.
    1.13 + * The index value of an iterator is the incremented when the iterator advanced without removal.
    1.14 + * In other words, when the iterator is finished, \c index==size .
    1.15 + *
    1.16 + * @param itemsize the size of one element
    1.17 + * @return a pointer to the new hash map
    1.18 + */
    1.19 +#define cxHashMapCreateSimple(itemsize) \
    1.20 +    cxHashMapCreate(cxDefaultAllocator, itemsize, 0)
    1.21 +
    1.22 +/**
    1.23   * Increases the number of buckets, if necessary.
    1.24   *
    1.25   * The load threshold is \c 0.75*buckets. If the element count exceeds the load

mercurial