Add extent serial numbers.

Add extent serial numbers and use them where appropriate as a sort key
that is higher priority than address, so that the allocation policy
prefers older extents.

This resolves #147.
This commit is contained in:
Jason Evans 2016-11-15 13:07:53 -08:00
parent c0a667112c
commit a38acf716e
7 changed files with 126 additions and 35 deletions

View file

@ -142,7 +142,8 @@ extent_alloc_dss(tsdn_t *tsdn, arena_t *arena, void *new_addr, size_t size,
gap_size = (uintptr_t)ret - (uintptr_t)gap_addr;
if (gap_size != 0) {
extent_init(gap, arena, gap_addr, gap_size,
gap_size, false, false, true, false);
gap_size, arena_extent_sn_next(arena),
false, false, true, false);
}
dss_next = (void *)((uintptr_t)ret + size);
if ((uintptr_t)ret < (uintptr_t)max_cur ||