Commit 908d3bda authored by Yoav Steinberg's avatar Yoav Steinberg
Browse files

Fix defrag to support sharded bins in arena (added in v5.2.1)

See https://github.com/jemalloc/jemalloc/commit/37b89139252db18c95ebce3e0eac67817fa4a8ab
parent 91bc78a8
...@@ -232,7 +232,8 @@ iget_defrag_hint(tsdn_t *tsdn, void* ptr, int *bin_util, int *run_util) { ...@@ -232,7 +232,8 @@ iget_defrag_hint(tsdn_t *tsdn, void* ptr, int *bin_util, int *run_util) {
extent_t *slab = iealloc(tsdn, ptr); extent_t *slab = iealloc(tsdn, ptr);
arena_t *arena = extent_arena_get(slab); arena_t *arena = extent_arena_get(slab);
szind_t binind = extent_szind_get(slab); szind_t binind = extent_szind_get(slab);
bin_t *bin = &arena->bins[binind]; unsigned binshard = extent_binshard_get(slab);
bin_t *bin = &arena->bins[binind].bin_shards[binshard];
malloc_mutex_lock(tsdn, &bin->lock); malloc_mutex_lock(tsdn, &bin->lock);
/* don't bother moving allocations from the slab currently used for new allocations */ /* don't bother moving allocations from the slab currently used for new allocations */
if (slab != bin->slabcur) { if (slab != bin->slabcur) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment