simplify init function
parent
433af6d4ba
commit
ef098fea06
6
malloc.c
6
malloc.c
|
@ -708,12 +708,10 @@ COLD static void init_slow_path(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void init(void) {
|
static inline void init(void) {
|
||||||
if (likely(is_init())) {
|
if (unlikely(!is_init())) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
init_slow_path();
|
init_slow_path();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// trigger early initialization to set up pthread_atfork and protect state as soon as possible
|
// trigger early initialization to set up pthread_atfork and protect state as soon as possible
|
||||||
COLD __attribute__((constructor(101))) static void trigger_early_init(void) {
|
COLD __attribute__((constructor(101))) static void trigger_early_init(void) {
|
||||||
|
|
Loading…
Reference in New Issue