diff options
author | jackpoz <giacomopoz@gmail.com> | 2017-11-19 20:23:00 +0100 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2021-02-15 19:13:25 +0100 |
commit | 65f4666063ebd8207bf09f528797467c5a30fd9d (patch) | |
tree | 2b185a42d33043079f46510e19fbcea1f017eb3b /dep/jemalloc/src/mutex_pool.c | |
parent | 55c63d7d833eb2b1cc08adb92725f2435108f7d2 (diff) |
Dep/Jemalloc: Update to Jemalloc 5.0.1
(cherry picked from commit 92cd9bd70db460fdce4af0596cf9d8ee3c3abad5)
Diffstat (limited to 'dep/jemalloc/src/mutex_pool.c')
-rw-r--r-- | dep/jemalloc/src/mutex_pool.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dep/jemalloc/src/mutex_pool.c b/dep/jemalloc/src/mutex_pool.c new file mode 100644 index 00000000000..f24d10e44a8 --- /dev/null +++ b/dep/jemalloc/src/mutex_pool.c @@ -0,0 +1,18 @@ +#define JEMALLOC_MUTEX_POOL_C_ + +#include "jemalloc/internal/jemalloc_preamble.h" +#include "jemalloc/internal/jemalloc_internal_includes.h" + +#include "jemalloc/internal/mutex.h" +#include "jemalloc/internal/mutex_pool.h" + +bool +mutex_pool_init(mutex_pool_t *pool, const char *name, witness_rank_t rank) { + for (int i = 0; i < MUTEX_POOL_SIZE; ++i) { + if (malloc_mutex_init(&pool->mutexes[i], name, rank, + malloc_mutex_address_ordered)) { + return true; + } + } + return false; +} |