Fix some reviewed items

This commit is contained in:
Lachlan Sneff
2019-01-29 12:49:51 -08:00
parent d73c7015fb
commit 767fdbd950
6 changed files with 31 additions and 7 deletions

View File

@ -7,6 +7,19 @@ use crate::{
pub const DYNAMIC_GUARD_SIZE: usize = 4096;
/// This is an internal-only api.
///
/// A Dynamic memory allocates only the minimum amount of memory
/// when first created. Over time, as it grows, it may reallocate to
/// a different location and size.
///
/// Dynamic memories are signifigantly faster to create than static
/// memories and use much less virtual memory, however, they require
/// the webassembly module to bounds-check memory accesses.
///
/// While, a dynamic memory could use a vector of some sort as its
/// backing memory, we use mmap (or the platform-equivalent) to allow
/// us to add a guard-page at the end to help elide some bounds-checks.
pub struct DynamicMemory {
memory: sys::Memory,
current: u32,