mdbx: minor refine def of cold/hot attributes.

Change-Id: I7ec80dde8b88885d7fb2ce5dbccb3726c4fe62f5
This commit is contained in:
Leo Yuriev 2016-04-15 21:34:23 +03:00
parent 1b780162dc
commit ef35aae2fe

View File

@ -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