add is_init likely/unlikely markers

pull/189/head 11
Daniel Micay 2022-01-21 19:46:49 -05:00
parent c9d1abcd7e
commit 995ce07d45
1 changed files with 5 additions and 5 deletions

View File

@ -1078,7 +1078,7 @@ COLD static void init_slow_path(void) {
mutex_lock(&lock); mutex_lock(&lock);
if (is_init()) { if (unlikely(is_init())) {
mutex_unlock(&lock); mutex_unlock(&lock);
return; return;
} }
@ -1823,7 +1823,7 @@ EXPORT struct mallinfo2 h_mallinfo2(void) {
#endif #endif
#if CONFIG_STATS #if CONFIG_STATS
if (!is_init()) { if (unlikely(!is_init())) {
return info; return info;
} }
@ -1866,7 +1866,7 @@ EXPORT int h_malloc_info(int options, UNUSED FILE *fp) {
fputs("<malloc version=\"hardened_malloc-1\">", fp); fputs("<malloc version=\"hardened_malloc-1\">", fp);
#if CONFIG_STATS #if CONFIG_STATS
if (is_init()) { if (likely(is_init())) {
thread_unseal_metadata(); thread_unseal_metadata();
for (unsigned arena = 0; arena < N_ARENA; arena++) { for (unsigned arena = 0; arena < N_ARENA; arena++) {
@ -1935,7 +1935,7 @@ EXPORT struct mallinfo h_mallinfo_arena_info(UNUSED size_t arena) {
struct mallinfo info = {0}; struct mallinfo info = {0};
#if CONFIG_STATS #if CONFIG_STATS
if (!is_init()) { if (unlikely(!is_init())) {
return info; return info;
} }
@ -1975,7 +1975,7 @@ EXPORT struct mallinfo h_mallinfo_bin_info(UNUSED size_t arena, UNUSED size_t bi
struct mallinfo info = {0}; struct mallinfo info = {0};
#if CONFIG_STATS #if CONFIG_STATS
if (!is_init()) { if (unlikely(!is_init())) {
return info; return info;
} }