free functions should not be inline in release mode - relates to #541

Sun, 05 Jan 2025 14:03:30 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 05 Jan 2025 14:03:30 +0100
changeset 1109
89ec23988b88
parent 1108
c3bde8ff1c0b
child 1110
a0e9be7ed131

free functions should not be inline in release mode - relates to #541

check-all.sh file | annotate | diff | comparison | revisions
src/cx/list.h file | annotate | diff | comparison | revisions
src/cx/map.h file | annotate | diff | comparison | revisions
src/cx/tree.h file | annotate | diff | comparison | revisions
src/list.c file | annotate | diff | comparison | revisions
src/map.c file | annotate | diff | comparison | revisions
src/tree.c file | annotate | diff | comparison | revisions
--- a/check-all.sh	Sun Jan 05 13:54:09 2025 +0100
+++ b/check-all.sh	Sun Jan 05 14:03:30 2025 +0100
@@ -36,6 +36,10 @@
 printf "Check w/o szmul builtin (c++)... "
 perform_check_cxx
 
+printf "Check release config... "
+./configure --release > /dev/null
+perform_check
+
 printf "Check gcc C23 preview... "
 CC=gcc CFLAGS=-std=c23 ./configure --debug > /dev/null
 perform_check
--- a/src/cx/list.h	Sun Jan 05 13:54:09 2025 +0100
+++ b/src/cx/list.h	Sun Jan 05 14:03:30 2025 +0100
@@ -885,10 +885,7 @@
  *
  * @param list the list which shall be freed
  */
-static inline void cxListFree(CxList *list) {
-    if (list == NULL) return;
-    list->cl->deallocate(list);
-}
+void cxListFree(CxList *list);
 
 /**
  * A shared instance of an empty list.
--- a/src/cx/map.h	Sun Jan 05 13:54:09 2025 +0100
+++ b/src/cx/map.h	Sun Jan 05 14:03:30 2025 +0100
@@ -210,10 +210,7 @@
  *
  * @param map the map to be freed
  */
-static inline void cxMapFree(CxMap *map) {
-    if (map == NULL) return;
-    map->cl->deallocate(map);
-}
+void cxMapFree(CxMap *map);
 
 
 /**
--- a/src/cx/tree.h	Sun Jan 05 13:54:09 2025 +0100
+++ b/src/cx/tree.h	Sun Jan 05 14:03:30 2025 +0100
@@ -932,13 +932,7 @@
  *
  * @param tree the tree to free
  */
-static inline void cxTreeFree(CxTree *tree) {
-    if (tree == NULL) return;
-    if (tree->root != NULL) {
-        cxTreeClear(tree);
-    }
-    cxFree(tree->allocator, tree);
-}
+void cxTreeFree(CxTree *tree);
 
 /**
  * Creates a new tree structure based on the specified layout.
--- a/src/list.c	Sun Jan 05 13:54:09 2025 +0100
+++ b/src/list.c	Sun Jan 05 14:03:30 2025 +0100
@@ -481,3 +481,8 @@
     it.base.mutating = true;
     return it;
 }
+
+void cxListFree(CxList *list) {
+    if (list == NULL) return;
+    list->cl->deallocate(list);
+}
--- a/src/map.c	Sun Jan 05 13:54:09 2025 +0100
+++ b/src/map.c	Sun Jan 05 14:03:30 2025 +0100
@@ -100,3 +100,8 @@
     it.base.mutating = true;
     return it;
 }
+
+void cxMapFree(CxMap *map) {
+    if (map == NULL) return;
+    map->cl->deallocate(map);
+}
--- a/src/tree.c	Sun Jan 05 13:54:09 2025 +0100
+++ b/src/tree.c	Sun Jan 05 14:03:30 2025 +0100
@@ -844,6 +844,14 @@
     return tree;
 }
 
+void cxTreeFree(CxTree *tree) {
+    if (tree == NULL) return;
+    if (tree->root != NULL) {
+        cxTreeClear(tree);
+    }
+    cxFree(tree->allocator, tree);
+}
+
 CxTree *cxTreeCreateWrapped(
         const CxAllocator *allocator,
         void *root,

mercurial