diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-03-28 15:13:04 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-03-28 15:27:45 -0400 |
commit | 0219441e5911b35035e927846cd8a0af77324f07 (patch) | |
tree | 0e7f393ebc9d0044ab1783038a2040ed565a3983 /src/config.h | |
parent | ff1b3d12cb798477b64c09cc0e3b9b2b6bc3e9da (diff) | |
download | bfs-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.
Diffstat (limited to 'src/config.h')
-rw-r--r-- | src/config.h | 2 |
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)) |