Wasmtime
wasmtime::MemoryType Class Reference

Type information about a WebAssembly linear memory. More...

#include <memory.hh>

Data Structures

class  Builder
 Helper class to build a MemoryType. More...
 
class  Ref
 Non-owning reference to a MemoryType, must not be used after the original owner has been deleted. More...
 

Public Member Functions

 MemoryType (Ref other)
 
 MemoryType (const MemoryType &other)
 Copies the provided type into a new type.
 
MemoryType & operator= (const MemoryType &other)
 Copies the provided type into a new type.
 
 MemoryType (MemoryType &&other)=default
 Moves the type information from another type into this one.
 
MemoryType & operator= (MemoryType &&other)=default
 Moves the type information from another type into this one.
 
Ref * operator-> ()
 Returns the underlying Ref, a non-owning reference pointing to this instance.
 
Ref * operator* ()
 Returns the underlying Ref, a non-owning reference pointing to this instance.
 

Static Public Member Functions

static Result< MemoryType > create (uint32_t min, std::optional< uint32_t > max=std::nullopt)
 
static Result< MemoryType > create64 (uint64_t min, std::optional< uint64_t > max=std::nullopt)
 Same as MemoryType::create, except creates a 64-bit memory.
 

Friends

class Memory
 

Detailed Description

Type information about a WebAssembly linear memory.

Constructor & Destructor Documentation

◆ MemoryType()

wasmtime::MemoryType::MemoryType ( Ref  other)
inline

Creates a new wasm memory type from the specified ref, making a fresh owned value.

Member Function Documentation

◆ create()

static Result< MemoryType > wasmtime::MemoryType::create ( uint32_t  min,
std::optional< uint32_t >  max = std::nullopt 
)
inlinestatic

Creates a new 32-bit wasm memory type with the specified minimum number of pages and optional maximum number of pages.

Returns an error if the limits are invalid.


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