summaryrefslogtreecommitdiffstats
path: root/src/arena.c
diff options
context:
space:
mode:
authorDavid T. Goldblatt <davidtgoldblatt@gmail.com>2017-10-02 01:02:39 (GMT)
committerDavid Goldblatt <davidtgoldblatt@gmail.com>2017-12-19 00:29:10 (GMT)
commita8dd8876fb483f402833fa05f0fb46fe7c5416e1 (patch)
treebd6dfde1ad99f87157e07e56c721ae3911ab4dbb /src/arena.c
parent4bf4a1c4ea418ba490d35d23aee0f535e96ddd23 (diff)
downloadjemalloc-a8dd8876fb483f402833fa05f0fb46fe7c5416e1.zip
jemalloc-a8dd8876fb483f402833fa05f0fb46fe7c5416e1.tar.gz
jemalloc-a8dd8876fb483f402833fa05f0fb46fe7c5416e1.tar.bz2
Move bin initialization from arena module to bin module.
Diffstat (limited to 'src/arena.c')
-rw-r--r--src/arena.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/arena.c b/src/arena.c
index 2dcb447..0d27ffb 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -2042,17 +2042,10 @@ arena_new(tsdn_t *tsdn, unsigned ind, extent_hooks_t *extent_hooks) {
/* Initialize bins. */
for (i = 0; i < NBINS; i++) {
- bin_t *bin = &arena->bins[i];
- if (malloc_mutex_init(&bin->lock, "arena_bin",
- WITNESS_RANK_ARENA_BIN, malloc_mutex_rank_exclusive)) {
+ bool err = bin_init(&arena->bins[i]);
+ if (err) {
goto label_error;
}
- bin->slabcur = NULL;
- extent_heap_new(&bin->slabs_nonfull);
- extent_list_init(&bin->slabs_full);
- if (config_stats) {
- memset(&bin->stats, 0, sizeof(malloc_bin_stats_t));
- }
}
arena->base = base;