summaryrefslogtreecommitdiff
path: root/src/kernel/mem/_dlmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/mem/_dlmalloc.c')
-rw-r--r--src/kernel/mem/_dlmalloc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kernel/mem/_dlmalloc.c b/src/kernel/mem/_dlmalloc.c
index 18dabab..30c6622 100644
--- a/src/kernel/mem/_dlmalloc.c
+++ b/src/kernel/mem/_dlmalloc.c
@@ -912,6 +912,14 @@ static FORCEINLINE int win32munmap(void* ptr, size_t size) {
/* #define TRY_LOCK(lk) ... */
/* static MLOCK_T malloc_global_mutex = ... */
+#define MLOCK_T uint32_t
+#define INITIAL_LOCK(l) (*l = MUTEX_UNLOCKED)
+#define DESTROY_LOCK(l) (0)
+#define ACQUIRE_LOCK(l) (mutex_lock (l))
+#define RELEASE_LOCK(l) (mutex_unlock (l))
+#define TRY_LOCK(l) (mutex_lockE(l))
+static MLOCK_T malloc_global_mutex = MUTEX_UNLOCKED;
+
#elif USE_SPIN_LOCKS
/* First, define CAS_LOCK and CLEAR_LOCK on ints */