mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-10-01 01:36:01 -04:00
add inline hints for init and enforce_init
This commit is contained in:
parent
67b9608ccf
commit
33f862ec19
4
malloc.c
4
malloc.c
@ -659,7 +659,7 @@ COLD static void init_slow_path(void) {
|
||||
pthread_mutex_unlock(&mutex);
|
||||
}
|
||||
|
||||
static void init(void) {
|
||||
static inline void init(void) {
|
||||
if (likely(atomic_load_explicit(&ro.initialized, memory_order_acquire))) {
|
||||
return;
|
||||
}
|
||||
@ -667,7 +667,7 @@ static void init(void) {
|
||||
init_slow_path();
|
||||
}
|
||||
|
||||
static void enforce_init(void) {
|
||||
static inline void enforce_init(void) {
|
||||
if (!atomic_load_explicit(&ro.initialized, memory_order_acquire)) {
|
||||
fatal_error("invalid uninitialized allocator usage");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user