diff options
author | Qi Wang <interwq@gwu.edu> | 2019-07-29 18:43:08 (GMT) |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2019-07-29 23:19:36 (GMT) |
commit | c9cdc1b27f8aa9c1e81e733e60d470c04be960b3 (patch) | |
tree | 745deff8f8373f8b52084b6007f11d83b16c6ae8 | |
parent | 5742473cc87558b4655064ebacfd837119673928 (diff) | |
download | jemalloc-c9cdc1b27f8aa9c1e81e733e60d470c04be960b3.zip jemalloc-c9cdc1b27f8aa9c1e81e733e60d470c04be960b3.tar.gz jemalloc-c9cdc1b27f8aa9c1e81e733e60d470c04be960b3.tar.bz2 |
Limit to exact fit on Windows with retain off.
W/o retain, split and merge are disallowed on Windows. Avoid doing first-fit
which needs splitting almost always. Instead, try exact fit only and bail out
early.
-rw-r--r-- | src/extent.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/extent.c b/src/extent.c index a2dbde1..9237f90 100644 --- a/src/extent.c +++ b/src/extent.c @@ -445,6 +445,16 @@ extents_first_fit_locked(tsdn_t *tsdn, arena_t *arena, extents_t *extents, extent_t *ret = NULL; pszind_t pind = sz_psz2ind(extent_size_quantize_ceil(size)); + + if (!maps_coalesce && !opt_retain) { + /* + * No split / merge allowed (Windows w/o retain). Try exact fit + * only. + */ + return extent_heap_empty(&extents->heaps[pind]) ? NULL : + extent_heap_first(&extents->heaps[pind]); + } + for (pszind_t i = (pszind_t)bitmap_ffu(extents->bitmap, &extents_bitmap_info, (size_t)pind); i < SC_NPSIZES + 1; |