From 1b8b87ba012ee51fb2d5336c9419854efe0ad052 Mon Sep 17 00:00:00 2001 From: Antonin Reitz Date: Tue, 17 Oct 2023 20:38:30 +0200 Subject: [PATCH] snap --- src/lib-alloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib-alloc.c b/src/lib-alloc.c index a5a8bb13..4d62f1ed 100644 --- a/src/lib-alloc.c +++ b/src/lib-alloc.c @@ -38,9 +38,9 @@ void* malloc(size_t size) { void* aligned_alloc(size_t alignment, size_t size) { if (! init_status) { + init_status=1UL; pthread_mutex_lock(&m); krmlinit_globals(); - init_status=1UL; pthread_mutex_unlock(&m); } if (thread_arena == N_ARENA) { @@ -51,9 +51,9 @@ void* aligned_alloc(size_t alignment, size_t size) { void free(void *ptr) { if (! init_status) { + init_status=1UL; pthread_mutex_lock(&m); krmlinit_globals(); - init_status=1UL; pthread_mutex_unlock(&m); } //printf("free ptr: %p\n", ptr); @@ -64,9 +64,9 @@ void free(void *ptr) { void* realloc(void* ptr, size_t new_size) { if (! init_status) { + init_status=1UL; pthread_mutex_lock(&m); krmlinit_globals(); - init_status=1UL; pthread_mutex_unlock(&m); } if (thread_arena == N_ARENA) { @@ -80,9 +80,9 @@ void* realloc(void* ptr, size_t new_size) { void* calloc(size_t nb_elem, size_t size_elem) { if (! init_status) { + init_status=1UL; pthread_mutex_lock(&m); krmlinit_globals(); - init_status=1UL; pthread_mutex_unlock(&m); } if (thread_arena == N_ARENA) { @@ -94,9 +94,9 @@ void* calloc(size_t nb_elem, size_t size_elem) { size_t malloc_usable_size(void* ptr) { if (! init_status) { + init_status=1UL; pthread_mutex_lock(&m); krmlinit_globals(); - init_status=1UL; pthread_mutex_unlock(&m); } return StarMalloc_getsize(ptr);