add inline hints for init and enforce_init

This commit is contained in:
Daniel Micay 2018-08-27 09:23:35 -04:00
parent 67b9608ccf
commit 33f862ec19

View File

@ -659,7 +659,7 @@ COLD static void init_slow_path(void) {
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
} }
static void init(void) { static inline void init(void) {
if (likely(atomic_load_explicit(&ro.initialized, memory_order_acquire))) { if (likely(atomic_load_explicit(&ro.initialized, memory_order_acquire))) {
return; return;
} }
@ -667,7 +667,7 @@ static void init(void) {
init_slow_path(); init_slow_path();
} }
static void enforce_init(void) { static inline void enforce_init(void) {
if (!atomic_load_explicit(&ro.initialized, memory_order_acquire)) { if (!atomic_load_explicit(&ro.initialized, memory_order_acquire)) {
fatal_error("invalid uninitialized allocator usage"); fatal_error("invalid uninitialized allocator usage");
} }