Kagome
Polkadot Runtime Engine in C++17
|
#include <memory.hpp>
Public Member Functions | |
virtual | ~Memory ()=default |
virtual WasmSize | size () const =0 |
Return the size of the memory. More... | |
virtual void | resize (WasmSize new_size)=0 |
virtual WasmPointer | allocate (WasmSize size)=0 |
virtual std::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 common::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 More... | |
Static Public Attributes | |
static constexpr uint32_t | kMaxMemorySize |
The underlying memory can be accessed through unaligned pointers which isn't well-behaved in C++. WebAssembly nonetheless expects it to behave properly. Avoid emitting unaligned load/store by checking for alignment explicitly, and performing memcpy if unaligned.
The allocated memory tries to have the same alignment as the memory being simulated.
Definition at line 39 of file memory.hpp.
|
virtualdefault |
|
pure virtual |
Allocates memory of given size and returns address in the memory
size | allocated memory size |
Implemented in kagome::runtime::binaryen::MemoryImpl, and kagome::runtime::wavm::MemoryImpl.
|
pure virtual |
Deallocates memory in provided region
ptr | address of deallocated memory |
Implemented in kagome::runtime::binaryen::MemoryImpl, and kagome::runtime::wavm::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Load integers from provided address
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Load bytes from provided address into the buffer of size n
addr | address in memory to load bytes |
n | number of bytes to be loaded |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Load string from address into buffer of size n
addr | address in memory to load bytes |
n | number of bytes |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Resizes memory to the given size
new_size |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Return the size of the memory.
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Store integers at given address of the wasm memory
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
pure virtual |
allocates buffer in memory and copies value into memory
value | buffer to store |
Implemented in kagome::runtime::wavm::MemoryImpl, and kagome::runtime::binaryen::MemoryImpl.
|
static |
Definition at line 43 of file memory.hpp.