pub fn alloc(initial: Pages, maximum: Option<Pages>) -> Result<MemoryRef, Error> {
		validate_memory(initial, maximum).map_err(Error::Memory)?;

		let memory = MemoryInstance::new(initial, maximum);
		Ok(MemoryRef(Rc::new(memory)))
	}
/// Allocate a memory instance.
///
/// The memory allocated with initial number of pages specified by `initial`.
/// Minimal possible value for `initial` is 0 and maximum possible is `65536`.
/// (Since maximum addressible memory is 2<sup>32</sup> = 4GiB = 65536 * [64KiB][`LINEAR_MEMORY_PAGE_SIZE`]).
///
/// It is possible to limit maximum number of pages this memory instance can have by specifying
/// `maximum`. If not specified, this memory instance would be able to allocate up to 4GiB.
///
/// Allocated memory is always zeroed.
///
/// # Errors
///
/// Returns `Err` if:
///
/// - `initial` is greater than `maximum`
/// - either `initial` or `maximum` is greater than `65536`.
///
/// [`LINEAR_MEMORY_PAGE_SIZE`]: constant.LINEAR_MEMORY_PAGE_SIZE.html
Allocate a memory instance.
The memory allocated with initial number of pages specified by `initial`.
Minimal possible value for `initial` is 0 and maximum possible is `65536`.
(Since maximum addressible memory is 232 = 4GiB = 65536 * [64KiB][`LINEAR_MEMORY_PAGE_SIZE`]).

It is possible to limit maximum number of pages this memory instance can have by specifying
`maximum`. If not specified, this memory instance would be able to allocate up to 4GiB.

Allocated memory is always zeroed.
Allocate a memory instance . The memory allocated with initial number of pages specified by ` initial ` . Minimal possible value for ` initial ` is 0 and maximum possible is ` 65536 ` . ( Since maximum addressible memory is 232 = 4GiB = 65536 * [ 64KiB ] [ ` LINEAR_MEMORY_PAGE_SIZE ` ] ) . It is possible to limit maximum number of pages this memory instance can have by specifying ` maximum ` . If not specified this memory instance would be able to allocate up to 4GiB . Allocated memory is always zeroed .
pub fn alloc(initial: Pages, maximum: Option<Pages>) -> Result<MemoryRef, Error> {
		validate_memory(initial, maximum).map_err(Error::Memory)?;
		let memory = MemoryInstance::new(initial, maximum);
		Ok(MemoryRef(Rc::new(memory)))
	}
pub fn alloc ( initial : Pages , maximum : Option < Pages > ) -> Result < MemoryRef , Error > { validate_memory ( initial , maximum ) . map_err ( Error :: Memory ) ? ; let memory = MemoryInstance :: new ( initial , maximum ) ; Ok ( MemoryRef ( Rc :: new ( memory ) ) ) }
Allocate a memory instance.
Allocate a memory instance .
initial
Pages
maximum
Option<Pages>
initial
Pages
maximum
Option<Pages>
errors
Returns `Err` if.

`initial` is greater than `maximum`
either `initial` or `maximum` is greater than `65536`.

[`LINEAR_MEMORY_PAGE_SIZE`]: constant.LINEAR_MEMORY_PAGE_SIZE.html
Returns ` Err ` if . ` initial ` is greater than ` maximum ` either ` initial ` or ` maximum ` is greater than ` 65536 ` . [ ` LINEAR_MEMORY_PAGE_SIZE ` ] : constant . LINEAR_MEMORY_PAGE_SIZE . html