Skip to content

Commit

Permalink
fix failure for macos.
Browse files Browse the repository at this point in the history
Signed-off-by: Lipeng Zhu <[email protected]>
  • Loading branch information
lipzhu committed Jun 14, 2024
1 parent a860c21 commit aeb8159
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/zmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ void zlibc_free(void *ptr) {
#include <string.h>
#include "zmalloc.h"
#include <stdatomic.h>
#include <threads.h>

#define UNUSED(x) ((void)(x))

Expand Down Expand Up @@ -88,6 +87,12 @@ void zlibc_free(void *ptr) {
#define dallocx(ptr, flags) je_dallocx(ptr, flags)
#endif

#if __STDC_NO_THREADS__
#define thread_local __thread
#else
#include <threads.h>
#endif

static _Atomic int64_t used_memory = 0;
static thread_local int64_t thread_used_memory_delta = 0;

Expand Down

0 comments on commit aeb8159

Please sign in to comment.