mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 16:32:06 +08:00
mdbx: minor refine def of cold/hot attributes.
Change-Id: I7ec80dde8b88885d7fb2ce5dbccb3726c4fe62f5
This commit is contained in:
parent
1b780162dc
commit
ef35aae2fe
5
reopen.h
5
reopen.h
@ -70,6 +70,9 @@
|
|||||||
#ifndef __hot
|
#ifndef __hot
|
||||||
# if defined(NDEBUG) && (defined(__GNUC__) && !defined(__clang__))
|
# if defined(NDEBUG) && (defined(__GNUC__) && !defined(__clang__))
|
||||||
# define __hot __attribute__((hot, optimize("O3")))
|
# 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
|
# else
|
||||||
# define __hot
|
# define __hot
|
||||||
# endif
|
# endif
|
||||||
@ -80,7 +83,7 @@
|
|||||||
# define __cold __attribute__((cold, optimize("Os")))
|
# define __cold __attribute__((cold, optimize("Os")))
|
||||||
# elif defined(__GNUC__)
|
# elif defined(__GNUC__)
|
||||||
/* cland case, just put infrequently used functions in separate section */
|
/* cland case, just put infrequently used functions in separate section */
|
||||||
# define __cold __attribute__((section("text.cold")))
|
# define __cold __attribute__((section("text.unlikely")))
|
||||||
# else
|
# else
|
||||||
# define __cold
|
# define __cold
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user