Fix the bug that causes not allocating free run with lowest address.
This commit is contained in:
parent
087ef3bc71
commit
55c9aa1038
@ -107,8 +107,12 @@ arena_avail_comp(arena_chunk_map_t *a, arena_chunk_map_t *b)
|
|||||||
a_size = arena_mapelm_to_bits(a) & ~PAGE_MASK;
|
a_size = arena_mapelm_to_bits(a) & ~PAGE_MASK;
|
||||||
|
|
||||||
ret = (a_size > b_size) - (a_size < b_size);
|
ret = (a_size > b_size) - (a_size < b_size);
|
||||||
if (ret == 0 && (!(a_mapelm & CHUNK_MAP_KEY)))
|
if (ret == 0) {
|
||||||
|
if (!(a_mapelm & CHUNK_MAP_KEY))
|
||||||
ret = (a_mapelm > b_mapelm) - (a_mapelm < b_mapelm);
|
ret = (a_mapelm > b_mapelm) - (a_mapelm < b_mapelm);
|
||||||
|
else
|
||||||
|
ret = -1;
|
||||||
|
}
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user