Mmap API tidying.

Establish more clear expectations for who is expected to page-align what
and when.
This commit is contained in:
Dan Gohman
2019-01-07 10:08:40 -08:00
parent 0826e32c9a
commit 0a2b0ee9b0
3 changed files with 40 additions and 62 deletions

View File

@@ -35,7 +35,7 @@ impl CodeMemory {
if self.current.len() - self.position < size {
self.mmaps.push(mem::replace(
&mut self.current,
Mmap::with_size(cmp::max(0x10000, size.next_power_of_two()))?,
Mmap::with_at_least(cmp::max(0x10000, size))?,
));
self.position = 0;
}