mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-10-01 01:36:01 -04:00
add is_init likely/unlikely markers
This commit is contained in:
parent
c9d1abcd7e
commit
995ce07d45
10
h_malloc.c
10
h_malloc.c
@ -1078,7 +1078,7 @@ COLD static void init_slow_path(void) {
|
||||
|
||||
mutex_lock(&lock);
|
||||
|
||||
if (is_init()) {
|
||||
if (unlikely(is_init())) {
|
||||
mutex_unlock(&lock);
|
||||
return;
|
||||
}
|
||||
@ -1823,7 +1823,7 @@ EXPORT struct mallinfo2 h_mallinfo2(void) {
|
||||
#endif
|
||||
|
||||
#if CONFIG_STATS
|
||||
if (!is_init()) {
|
||||
if (unlikely(!is_init())) {
|
||||
return info;
|
||||
}
|
||||
|
||||
@ -1866,7 +1866,7 @@ EXPORT int h_malloc_info(int options, UNUSED FILE *fp) {
|
||||
fputs("<malloc version=\"hardened_malloc-1\">", fp);
|
||||
|
||||
#if CONFIG_STATS
|
||||
if (is_init()) {
|
||||
if (likely(is_init())) {
|
||||
thread_unseal_metadata();
|
||||
|
||||
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};
|
||||
|
||||
#if CONFIG_STATS
|
||||
if (!is_init()) {
|
||||
if (unlikely(!is_init())) {
|
||||
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};
|
||||
|
||||
#if CONFIG_STATS
|
||||
if (!is_init()) {
|
||||
if (unlikely(!is_init())) {
|
||||
return info;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user