Skip to content

Commit

Permalink
snap
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonin Reitz committed Oct 17, 2023
1 parent 60b818b commit 1b8b87b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 1b8b87b

Please sign in to comment.