Wasmtime
wasmtime::MemoryType::Builder Class Reference

Helper class to build a MemoryType. More...

#include <memory.hh>

Public Member Functions

 Builder ()
 Default constructor for a memory type with 0 initial size.
 
Buildermin (uint64_t min)
 Configure the minimum size, in pages, of linear memory.
 
Buildermax (std::optional< uint64_t > max)
 Configure the maximal size, in pages, of linear memory.
 
Buildermemory64 (bool enable)
 Configure whether this is a 64-bit linear memory.
 
Buildershared (bool enable)
 Configure whether this is a shared linear memory.
 
Builderpage_size_log2 (uint8_t page_size_log2)
 Configure the page size (in bytes) of this memory type, via its log2 value. More...
 
Result< MemoryTypebuild () const
 Construct the final MemoryType value.
 

Detailed Description

Helper class to build a MemoryType.

Member Function Documentation

◆ page_size_log2()

Builder & wasmtime::MemoryType::Builder::page_size_log2 ( uint8_t  page_size_log2)
inline

Configure the page size (in bytes) of this memory type, via its log2 value.

The default Wasm page size is 65536 (or 2**16).

With the custom-page-sizes proposal, you can configure 1-byte (or 2**0) pages by passing 0 to this method. Future extensions may enable any power-of-two page size.


The documentation for this class was generated from the following file: