From ef35aae2feddaec1e529736837e37ead5380f2c2 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Fri, 15 Apr 2016 21:34:23 +0300 Subject: [PATCH] mdbx: minor refine def of cold/hot attributes. Change-Id: I7ec80dde8b88885d7fb2ce5dbccb3726c4fe62f5 --- reopen.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reopen.h b/reopen.h index 7572ba46..2cd902e8 100644 --- a/reopen.h +++ b/reopen.h @@ -70,6 +70,9 @@ #ifndef __hot # if defined(NDEBUG) && (defined(__GNUC__) && !defined(__clang__)) # define __hot __attribute__((hot, optimize("O3"))) +# elif defined(__GNUC__) + /* cland case, just put frequently used functions in separate section */ +# define __cold __attribute__((section("text.hot"))) # else # define __hot # endif @@ -80,7 +83,7 @@ # define __cold __attribute__((cold, optimize("Os"))) # elif defined(__GNUC__) /* cland case, just put infrequently used functions in separate section */ -# define __cold __attribute__((section("text.cold"))) +# define __cold __attribute__((section("text.unlikely"))) # else # define __cold # endif