Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 9c43c13

Browse files
author
Jason Evans
committed
Reverse tcache fill order.
Refill the thread cache such that low regions get used first. This fixes a regression due to the recent transition to bitmap-based region management.
1 parent 84c8eef commit 9c43c13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jemalloc/src/arena.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,8 @@ arena_tcache_fill_small(arena_t *arena, tcache_bin_t *tbin, size_t binind
13601360
ptr = arena_bin_malloc_hard(arena, bin);
13611361
if (ptr == NULL)
13621362
break;
1363-
tbin->avail[i] = ptr;
1363+
/* Insert such that low regions get used first. */
1364+
tbin->avail[nfill - 1 - i] = ptr;
13641365
}
13651366
#ifdef JEMALLOC_STATS
13661367
bin->stats.allocated += (i - tbin->ncached) *

0 commit comments

Comments
 (0)