Publish LINEAR_MEMORY_PAGE_SIZE constant (#31)

This commit is contained in:
Sergey Pepyakin 2018-02-01 14:46:49 +03:00 committed by GitHub
parent 3ad9f07e93
commit 1d87fb09dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -220,7 +220,7 @@ mod types;
#[cfg(test)] #[cfg(test)]
mod tests; mod tests;
pub use self::memory::{MemoryInstance, MemoryRef}; pub use self::memory::{MemoryInstance, MemoryRef, LINEAR_MEMORY_PAGE_SIZE};
pub use self::table::{TableInstance, TableRef}; pub use self::table::{TableInstance, TableRef};
pub use self::value::RuntimeValue; pub use self::value::RuntimeValue;
pub use self::host::{Externals, NopExternals, HostError, RuntimeArgs}; pub use self::host::{Externals, NopExternals, HostError, RuntimeArgs};

View File

@ -8,8 +8,13 @@ use parity_wasm::elements::ResizableLimits;
use Error; use Error;
use module::check_limits; use module::check_limits;
/// Linear memory page size. /// Size of a page of [linear memory][`MemoryInstance`] - 64KiB.
///
/// The size of a memory is always a integer multiple of a page size.
///
/// [`MemoryInstance`]: struct.MemoryInstance.html
pub const LINEAR_MEMORY_PAGE_SIZE: u32 = 65536; pub const LINEAR_MEMORY_PAGE_SIZE: u32 = 65536;
/// Maximal number of pages. /// Maximal number of pages.
const LINEAR_MEMORY_MAX_PAGES: u32 = 65536; const LINEAR_MEMORY_MAX_PAGES: u32 = 65536;