sgns::runtime::WasmMemory¶
#include <wasm_memory.hpp>
Inherited by sgns::runtime::binaryen::WasmMemoryImpl
Public Functions¶
| Name | |
|---|---|
| virtual | ~WasmMemory() =default |
| virtual void | reset() =0 |
| virtual WasmSize | size() const =0 Return the size of the memory. |
| virtual void | resize(WasmSize newSize) =0 |
| virtual WasmPointer | allocate(WasmSize size) =0 |
| virtual boost::optional< WasmSize > | deallocate(WasmPointer ptr) =0 |
| virtual int8_t | load8s(WasmPointer addr) const =0 |
| virtual uint8_t | load8u(WasmPointer addr) const =0 |
| virtual int16_t | load16s(WasmPointer addr) const =0 |
| virtual uint16_t | load16u(WasmPointer addr) const =0 |
| virtual int32_t | load32s(WasmPointer addr) const =0 |
| virtual uint32_t | load32u(WasmPointer addr) const =0 |
| virtual int64_t | load64s(WasmPointer addr) const =0 |
| virtual uint64_t | load64u(WasmPointer addr) const =0 |
| virtual std::array< uint8_t, 16 > | load128(WasmPointer addr) const =0 |
| virtual base::Buffer | loadN(WasmPointer addr, WasmSize n) const =0 |
| virtual std::string | loadStr(WasmPointer addr, WasmSize n) const =0 |
| virtual void | store8(WasmPointer addr, int8_t value) =0 |
| virtual void | store16(WasmPointer addr, int16_t value) =0 |
| virtual void | store32(WasmPointer addr, int32_t value) =0 |
| virtual void | store64(WasmPointer addr, int64_t value) =0 |
| virtual void | store128(WasmPointer addr, const std::array< uint8_t, 16 > & value) =0 |
| virtual void | storeBuffer(WasmPointer addr, gsl::span< const uint8_t > value) =0 |
| virtual WasmSpan | storeBuffer(gsl::span< const uint8_t > value) =0 allocates buffer in memory and copies value into memory |
Public Attributes¶
| Name | |
|---|---|
| uint32_t | kMaxMemorySize |
Public Functions Documentation¶
function ~WasmMemory¶
function reset¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::reset
Resets allocated and deallocated memory information
function size¶
Return the size of the memory.
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::size
function resize¶
Parameters:
- newSize
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::resize
Resizes memory to the given size
function allocate¶
Parameters:
- size allocated memory size
Return: address to allocated memory. If there is no available slot for such allocation, then -1 is returned
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::allocate
Allocates memory of given size and returns address in the memory
function deallocate¶
Parameters:
- ptr address of deallocated memory
Return: size of deallocated memory or none if given address does not point to any allocated pieces of memory
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::deallocate
Deallocates memory in provided region
function load8s¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::load8s
Load integers from provided address
function load8u¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::load8u
function load16s¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::load16s
function load16u¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::load16u
function load32s¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::load32s
function load32u¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::load32u
function load64s¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::load64s
function load64u¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::load64u
function load128¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::load128
function loadN¶
Parameters:
- addr address in memory to load bytes
- n number of bytes to be loaded
Return: Buffer of length N
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::loadN
Load bytes from provided address into the buffer of size n
function loadStr¶
Parameters:
- addr address in memory to load bytes
- n number of bytes
Return: string with data
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::loadStr
Load string from address into buffer of size n
function store8¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::store8
Store integers at given address of the wasm memory
function store16¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::store16
function store32¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::store32
function store64¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::store64
function store128¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::store128
function storeBuffer¶
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::storeBuffer
function storeBuffer¶
allocates buffer in memory and copies value into memory
Parameters:
- value buffer to store
Return: full wasm pointer to allocated buffer
Reimplemented by: sgns::runtime::binaryen::WasmMemoryImpl::storeBuffer
Public Attributes Documentation¶
variable kMaxMemorySize¶
Updated on 2026-03-04 at 13:10:43 -0800