mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-04-19 22:10:19 +02:00
simplify init function
This commit is contained in:
parent
433af6d4ba
commit
ef098fea06
1 changed files with 2 additions and 4 deletions
6
malloc.c
6
malloc.c
|
@ -708,12 +708,10 @@ COLD static void init_slow_path(void) {
|
|||
}
|
||||
|
||||
static inline void init(void) {
|
||||
if (likely(is_init())) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (unlikely(!is_init())) {
|
||||
init_slow_path();
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue