Fix sa2u() regression.

Take large_pad into account when determining whether an aligned
allocation can be satisfied by a large size class.

This regression was introduced by
8a03cf039c (Implement cache index
randomization for large allocations.).
This commit is contained in:
Jason Evans 2015-07-23 17:14:11 -07:00
parent 50883deb6e
commit 4becdf21dc

View File

@ -708,7 +708,7 @@ sa2u(size_t size, size_t alignment)
* Calculate the size of the over-size run that arena_palloc() * Calculate the size of the over-size run that arena_palloc()
* would need to allocate in order to guarantee the alignment. * would need to allocate in order to guarantee the alignment.
*/ */
if (usize + alignment - PAGE <= arena_maxrun) if (usize + large_pad + alignment - PAGE <= arena_maxrun)
return (usize); return (usize);
} }