ucx/map.c

changeset 101
7b3a3130be44
parent 49
2f71f4ee247a
--- a/ucx/map.c	Thu Dec 12 20:01:43 2024 +0100
+++ b/ucx/map.c	Mon Jan 06 22:22:55 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