Kagome
Polkadot Runtime Engine in C++17
wavm_internal_memory_provider.cpp
Go to the documentation of this file.
1 
7 
11 
12 namespace kagome::runtime::wavm {
13 
15  WAVM::Runtime::Memory *memory)
16  : memory_{memory} {
17  BOOST_ASSERT(memory_ != nullptr);
18  }
19 
20  std::optional<std::reference_wrapper<runtime::Memory>>
22  return current_memory_
23  ? std::optional<std::reference_wrapper<runtime::Memory>>(
25  : std::nullopt;
26  }
27 
29  WasmSize heap_base) {
30  current_memory_ = std::make_unique<MemoryImpl>(memory_, heap_base);
31  return outcome::success();
32  }
33 
34 } // namespace kagome::runtime::wavm
uint32_t WasmSize
Size type is uint32_t because we are working in 32 bit address space.
Definition: types.hpp:35
std::optional< std::reference_wrapper< runtime::Memory > > getCurrentMemory() const override
outcome::result< void > resetMemory(WasmSize heap_base) override