15 case E::OUTDATED_EXTERNAL_INTERFACE:
16 return "Reference to the runtime external interface is outdated " 19 return "Unknown error in BinaryenMemoryProvider";
25 std::shared_ptr<const BinaryenMemoryFactory> memory_factory)
26 : memory_factory_{std::move(memory_factory)} {
30 std::optional<std::reference_wrapper<runtime::Memory>>
34 : std::optional<std::reference_wrapper<Memory>>{*
memory_};
40 BOOST_ASSERT(rei !=
nullptr);
43 return outcome::success();
49 std::weak_ptr<RuntimeExternalInterface> rei) {
50 BOOST_ASSERT(rei.lock() !=
nullptr);
uint32_t WasmSize
Size type is uint32_t because we are working in 32 bit address space.
OUTCOME_CPP_DEFINE_CATEGORY(kagome::runtime::binaryen, BinaryenMemoryProvider::Error, e)
outcome::result< void > resetMemory(WasmSize heap_base) override
BinaryenMemoryProvider(std::shared_ptr< const BinaryenMemoryFactory > memory_factory)
std::shared_ptr< MemoryImpl > memory_
void setExternalInterface(std::weak_ptr< RuntimeExternalInterface > rei)
std::shared_ptr< const BinaryenMemoryFactory > memory_factory_
std::optional< std::reference_wrapper< runtime::Memory > > getCurrentMemory() const override
std::weak_ptr< RuntimeExternalInterface > external_interface_