From ef098fea06286ea18d83cf0ea5833ee8f14f00fa Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Tue, 11 Sep 2018 14:12:27 -0400 Subject: [PATCH] simplify init function --- malloc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/malloc.c b/malloc.c index c5e6caa..b930819 100644 --- a/malloc.c +++ b/malloc.c @@ -708,11 +708,9 @@ COLD static void init_slow_path(void) { } static inline void init(void) { - if (likely(is_init())) { - return; + if (unlikely(!is_init())) { + init_slow_path(); } - - init_slow_path(); } // trigger early initialization to set up pthread_atfork and protect state as soon as possible