ucx/map.c

changeset 440
7c4b9cba09ca
parent 324
ce13a778654a
--- a/ucx/map.c	Sun Jan 05 17:41:39 2025 +0100
+++ b/ucx/map.c	Sun Jan 05 22:00:39 2025 +0100
@@ -31,24 +31,24 @@
 
 // <editor-fold desc="empty map implementation">
 
-static void cx_empty_map_noop(__attribute__((__unused__)) CxMap *map) {
+static void cx_empty_map_noop(cx_attr_unused CxMap *map) {
     // this is a noop, but MUST be implemented
 }
 
 static void *cx_empty_map_get(
-        __attribute__((__unused__)) const CxMap *map,
-        __attribute__((__unused__)) CxHashKey key
+        cx_attr_unused const CxMap *map,
+        cx_attr_unused CxHashKey key
 ) {
     return NULL;
 }
 
-static bool cx_empty_map_iter_valid(__attribute__((__unused__)) const void *iter) {
+static bool cx_empty_map_iter_valid(cx_attr_unused const void *iter) {
     return false;
 }
 
 static CxIterator cx_empty_map_iterator(
         const struct cx_map_s *map,
-        __attribute__((__unused__)) enum cx_map_iterator_type type
+        cx_attr_unused enum cx_map_iterator_type type
 ) {
     CxIterator iter = {0};
     iter.src_handle.c = map;
@@ -100,3 +100,8 @@
     it.base.mutating = true;
     return it;
 }
+
+void cxMapFree(CxMap *map) {
+    if (map == NULL) return;
+    map->cl->deallocate(map);
+}

mercurial