core::arch::wasm32::memory_size - Rust
Description: API documentation for the Rust `memory_size` fn in crate `core`.
Keywords: rust, rustlang, rust-lang, memory_size

# 1.33.0[−][src]Function core::arch::wasm32::memory_size

    pub fn memory_size(mem: u32) -> usize

This is supported on WebAssembly only.

Corresponding intrinsic to wasm's `memory.size` instruction

This function, when called, will return the current memory size in units of pages. The current WebAssembly page size is 65536 bytes (64 KB).

The argument `mem` is the numerical index of which memory to return the size of. Note that currently the WebAssembly specification only supports one memory, so it is required that zero is passed in. The argument is present to be forward-compatible with future WebAssembly revisions. If a nonzero argument is passed to this function it will currently unconditionally abort.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)