From 0219441e5911b35035e927846cd8a0af77324f07 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 28 Mar 2024 15:13:04 -0400 Subject: config: Allow inlining allocator functions GCC disables inlining on custom allocator/deallocator pairs, so that they can be matched up accurately in stack traces. --- src/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) -- cgit v1.2.3