summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-03-28 15:13:04 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-03-28 15:27:45 -0400
commit0219441e5911b35035e927846cd8a0af77324f07 (patch)
tree0e7f393ebc9d0044ab1783038a2040ed565a3983
parentff1b3d12cb798477b64c09cc0e3b9b2b6bc3e9da (diff)
downloadbfs-0219441e5911b35035e927846cd8a0af77324f07.tar.xz
config: Allow inlining allocator functions
GCC disables inlining on custom allocator/deallocator pairs, so that they can be matched up accurately in stack traces.
-rw-r--r--src/config.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/config.h b/src/config.h
index 892f24c..506ad3e 100644
--- a/src/config.h
+++ b/src/config.h
@@ -247,7 +247,7 @@ typedef long double max_align_t;
* Annotates allocator-like functions.
*/
#if __has_attribute(malloc)
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !__OPTIMIZE__ // malloc(deallocator) disables inlining on GCC
# define attr_malloc(...) attr_nodiscard __attribute__((malloc(__VA_ARGS__)))
# else
# define attr_malloc(...) attr_nodiscard __attribute__((malloc))