diff options
author | jackpoz <giacomopoz@gmail.com> | 2017-11-19 11:23:41 +0100 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2021-02-15 19:13:25 +0100 |
commit | 367e9f210eb5ec852458f65ec967497d919afd7a (patch) | |
tree | f8a51b3d5260fbf3e7e941397ad49fa735951991 /dep/jemalloc/src/mutex.c | |
parent | a9edd9dc47afc56ee0a4b8e9f2be2823e861903f (diff) |
Dep/Jemalloc: Update to Jemalloc 4.0.4
(cherry picked from commit cc6dec72863a771da0c0f3ab3d32f75d7ce863bd)
Diffstat (limited to 'dep/jemalloc/src/mutex.c')
-rw-r--r-- | dep/jemalloc/src/mutex.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/dep/jemalloc/src/mutex.c b/dep/jemalloc/src/mutex.c index 788eca38703..2d47af976c5 100644 --- a/dep/jemalloc/src/mutex.c +++ b/dep/jemalloc/src/mutex.c @@ -73,9 +73,13 @@ malloc_mutex_init(malloc_mutex_t *mutex) { #ifdef _WIN32 +# if _WIN32_WINNT >= 0x0600 + InitializeSRWLock(&mutex->lock); +# else if (!InitializeCriticalSectionAndSpinCount(&mutex->lock, _CRT_SPINCOUNT)) return (true); +# endif #elif (defined(JEMALLOC_OSSPIN)) mutex->lock = 0; #elif (defined(JEMALLOC_MUTEX_INIT_CB)) @@ -83,8 +87,8 @@ malloc_mutex_init(malloc_mutex_t *mutex) mutex->postponed_next = postponed_mutexes; postponed_mutexes = mutex; } else { - if (_pthread_mutex_init_calloc_cb(&mutex->lock, base_calloc) != - 0) + if (_pthread_mutex_init_calloc_cb(&mutex->lock, + bootstrap_calloc) != 0) return (true); } #else @@ -140,7 +144,7 @@ mutex_boot(void) postpone_init = false; while (postponed_mutexes != NULL) { if (_pthread_mutex_init_calloc_cb(&postponed_mutexes->lock, - base_calloc) != 0) + bootstrap_calloc) != 0) return (true); postponed_mutexes = postponed_mutexes->postponed_next; } |