mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-20 05:18:21 +08:00
mdbx: корректировка макросов __cold
/__hot
.
В том числе для устранения проблемы `error: inlining failed in call to ‘always_inline FOO(...)’: target specific option mismatch` при сборке посредством GCC >10.x для SH4.
This commit is contained in:
parent
b8092dd0db
commit
57ca0d6e1b
18
src/base.h
18
src/base.h
@ -572,17 +572,13 @@ __extern_C key_t ftok(const char *, int);
|
|||||||
|
|
||||||
#ifndef __hot
|
#ifndef __hot
|
||||||
#if defined(__OPTIMIZE__)
|
#if defined(__OPTIMIZE__)
|
||||||
#if defined(__e2k__)
|
#if defined(__clang__) && !__has_attribute(__hot__) && \
|
||||||
#define __hot __attribute__((__hot__)) __optimize(3)
|
|
||||||
#elif defined(__clang__) && !__has_attribute(__hot_) && \
|
|
||||||
__has_attribute(__section__) && \
|
__has_attribute(__section__) && \
|
||||||
(defined(__linux__) || defined(__gnu_linux__))
|
(defined(__linux__) || defined(__gnu_linux__))
|
||||||
/* just put frequently used functions in separate section */
|
/* just put frequently used functions in separate section */
|
||||||
#define __hot __attribute__((__section__("text.hot"))) __optimize("O3")
|
#define __hot __attribute__((__section__("text.hot"))) __optimize("O3")
|
||||||
#elif defined(__LCC__)
|
|
||||||
#define __hot __attribute__((__hot__, __optimize__("Ofast,O4")))
|
|
||||||
#elif defined(__GNUC__) || __has_attribute(__hot__)
|
#elif defined(__GNUC__) || __has_attribute(__hot__)
|
||||||
#define __hot __attribute__((__hot__)) __optimize("O3")
|
#define __hot __attribute__((__hot__))
|
||||||
#else
|
#else
|
||||||
#define __hot __optimize("O3")
|
#define __hot __optimize("O3")
|
||||||
#endif
|
#endif
|
||||||
@ -593,17 +589,13 @@ __extern_C key_t ftok(const char *, int);
|
|||||||
|
|
||||||
#ifndef __cold
|
#ifndef __cold
|
||||||
#if defined(__OPTIMIZE__)
|
#if defined(__OPTIMIZE__)
|
||||||
#if defined(__e2k__)
|
#if defined(__clang__) && !__has_attribute(__cold__) && \
|
||||||
#define __cold __attribute__((__cold__)) __optimize(1)
|
|
||||||
#elif defined(__clang__) && !__has_attribute(cold) && \
|
|
||||||
__has_attribute(__section__) && \
|
__has_attribute(__section__) && \
|
||||||
(defined(__linux__) || defined(__gnu_linux__))
|
(defined(__linux__) || defined(__gnu_linux__))
|
||||||
/* just put infrequently used functions in separate section */
|
/* just put infrequently used functions in separate section */
|
||||||
#define __cold __attribute__((__section__("text.unlikely"))) __optimize("Os")
|
#define __cold __attribute__((__section__("text.unlikely"))) __optimize("Os")
|
||||||
#elif defined(__LCC__)
|
#elif defined(__GNUC__) || __has_attribute(__cold__)
|
||||||
#define __hot __attribute__((__cold__, __optimize__("Osize")))
|
#define __cold __attribute__((__cold__))
|
||||||
#elif defined(__GNUC__) || __has_attribute(cold)
|
|
||||||
#define __cold __attribute__((__cold__)) __optimize("Os")
|
|
||||||
#else
|
#else
|
||||||
#define __cold __optimize("Os")
|
#define __cold __optimize("Os")
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user