Module gear_core::pages

source ·
Expand description

Module for memory pages.

Structs

  • Page number.
  • U32 size pages iterator, to iterate continuously from one page to another.
  • U32 size pages iterator, to iterate continuously from one page to another, including the last one.
  • Wasm page number.

Enums

  • Errors when act with PageU32Size.
  • An enum which distinguishes between different page sizes.

Constants

  • A gear page size, currently 4KiB to fit the most common native page size. This is size of memory data pages in storage. So, in lazy-pages, when program tries to access some memory interval - we can download just some number of gear pages instead of whole wasm page. The number of small pages, which must be downloaded, is depends on host native page size, so can vary.
  • A WebAssembly page has a constant size of 64KiB.

Traits

  • Page with dynamic size.
  • Page number trait - page, which can return it number as u32.
  • Trait represents page with u32 size for u32 memory: max memory size is 2^32 bytes. All operations with page guarantees, that no addr or page number can be overflowed.
  • Context where dynamic size pages store their sizes