ucx/hash_map.c

changeset 113
dde28a806552
parent 112
c3f2f16fa4b8
--- a/ucx/hash_map.c	Sun Oct 19 21:20:08 2025 +0200
+++ b/ucx/hash_map.c	Mon Nov 10 21:52:51 2025 +0100
@@ -86,7 +86,7 @@
     struct cx_hash_map_s *hash_map = (struct cx_hash_map_s *) map;
     const CxAllocator *allocator = map->collection.allocator;
 
-    unsigned hash = key.hash;
+    uint64_t hash = key.hash;
     if (hash == 0) {
         cx_hash_murmur(&key);
         hash = key.hash;
@@ -203,7 +203,7 @@
 ) {
     struct cx_hash_map_s *hash_map = (struct cx_hash_map_s *) map;
 
-    unsigned hash = key.hash;
+    uint64_t hash = key.hash;
     if (hash == 0) {
         cx_hash_murmur(&key);
         hash = key.hash;
@@ -281,7 +281,7 @@
 
 static void cx_hash_map_iter_next(void *it) {
     CxMapIterator *iter = it;
-    CxMap *map = iter->map.m;
+    CxMap *map = iter->map;
     struct cx_hash_map_s *hmap = (struct cx_hash_map_s *) map;
     struct cx_hash_map_element_s *elm = iter->elem;
 
@@ -329,7 +329,7 @@
     // must not modify the iterator (the parameter is const)
     if (elm != NULL) {
         iter->entry.key = &elm->key;
-        if (iter->map.c->collection.store_pointer) {
+        if (map->collection.store_pointer) {
             iter->entry.value = *(void **) elm->data;
         } else {
             iter->entry.value = elm->data;
@@ -343,7 +343,7 @@
 ) {
     CxMapIterator iter;
 
-    iter.map.c = map;
+    iter.map = (CxMap*) map;
     iter.elem_count = map->collection.size;
 
     switch (type) {
@@ -366,7 +366,7 @@
     iter.base.valid = cx_hash_map_iter_valid;
     iter.base.next = cx_hash_map_iter_next;
     iter.base.remove = false;
-    iter.base.mutating = false;
+    iter.base.allow_remove = true;
 
     iter.slot = 0;
     iter.index = 0;

mercurial