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

@@ -496,7 +496,7 @@ impl Instance {
num_defined_globals: vmctx_globals.len() as u64,
};
let mut contents_mmap = Mmap::with_size(
let mut contents_mmap = Mmap::with_at_least(
mem::size_of::<InstanceContents>()
.checked_add(cast::usize(offsets.size_of_vmctx()))
.unwrap(),