summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2019-07-23 19:49:17 (GMT)
committerQi Wang <interwq@gmail.com>2019-07-24 18:28:45 (GMT)
commit1d148f353a2c71bc12fd066e467649fd17df3c95 (patch)
treef6ef34f5bd0bd551393092ac0c322aec933f216b
parent4e36ce34c1e6a6f470a9355b90b0a757c6fdb0b5 (diff)
downloadjemalloc-1d148f353a2c71bc12fd066e467649fd17df3c95.zip
jemalloc-1d148f353a2c71bc12fd066e467649fd17df3c95.tar.gz
jemalloc-1d148f353a2c71bc12fd066e467649fd17df3c95.tar.bz2
Optimize max_active_fit in first_fit.
Stop scanning once reached the first max_active_fit size.
-rw-r--r--src/extent.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/extent.c b/src/extent.c
index 6fdb7b0..a2dbde1 100644
--- a/src/extent.c
+++ b/src/extent.c
@@ -453,7 +453,6 @@ extents_first_fit_locked(tsdn_t *tsdn, arena_t *arena, extents_t *extents,
assert(!extent_heap_empty(&extents->heaps[i]));
extent_t *extent = extent_heap_first(&extents->heaps[i]);
assert(extent_size_get(extent) >= size);
- bool size_ok = true;
/*
* In order to reduce fragmentation, avoid reusing and splitting
* large extents for much smaller sizes.
@@ -462,10 +461,9 @@ extents_first_fit_locked(tsdn_t *tsdn, arena_t *arena, extents_t *extents,
*/
if (extents->delay_coalesce &&
(sz_pind2sz(i) >> opt_lg_extent_max_active_fit) > size) {
- size_ok = false;
+ break;
}
- if (size_ok &&
- (ret == NULL || extent_snad_comp(extent, ret) < 0)) {
+ if (ret == NULL || extent_snad_comp(extent, ret) < 0) {
ret = extent;
}
if (i == SC_NPSIZES) {