From bb582e96dedb3e357bd8e64cccc32663eb540cbd Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 27 Nov 2021 09:11:35 +0000 Subject: [PATCH] Enabled pthread mutexes in dlmalloc --- photon/libc/malloc/dlmalloc/malloc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/photon/libc/malloc/dlmalloc/malloc.c b/photon/libc/malloc/dlmalloc/malloc.c index 2f7ba18..1423869 100644 --- a/photon/libc/malloc/dlmalloc/malloc.c +++ b/photon/libc/malloc/dlmalloc/malloc.c @@ -580,7 +580,9 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP #define LACKS_TIME_H #define LACKS_ERRNO_H #define LACKS_SCHED_H -#define USE_LOCKS 0 +#define USE_LOCKS 1 +#define USE_SPIN_LOCKS 0 +#define USE_RECURSIVE_LOCKS 0 #define MALLOC_FAILURE_ACTION extern void *__crt_heap_extend(size_t sz); @@ -615,11 +617,6 @@ extern void *__crt_heap_extend(size_t sz); /* The maximum possible size_t value has all bits set */ #define MAX_SIZE_T (~(size_t)0) -#ifndef USE_LOCKS /* ensure true if spin or recursive locks set */ -#define USE_LOCKS ((defined(USE_SPIN_LOCKS) && USE_SPIN_LOCKS != 0) || \ - (defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0)) -#endif /* USE_LOCKS */ - #if USE_LOCKS /* Spin locks for gcc >= 4.1, older gcc on x86, MSC >= 1310 */ #if ((defined(__GNUC__) && \ ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) || \ @@ -2806,6 +2803,7 @@ static void reset_on_error(mstate m); #ifndef CORRUPTION_ERROR_ACTION #define CORRUPTION_ERROR_ACTION(m) ABORT + #endif /* CORRUPTION_ERROR_ACTION */ #ifndef USAGE_ERROR_ACTION