Kagome
Polkadot Runtime Engine in C++17
wavm_internal_memory_provider.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_RUNTIME_WAVM_IMPL_WAVM_INTERNAL_MEMORY_PROVIDER_HPP
7 #define KAGOME_CORE_RUNTIME_WAVM_IMPL_WAVM_INTERNAL_MEMORY_PROVIDER_HPP
8 
10 
11 namespace WAVM::Runtime {
12  struct Memory;
13 }
14 
15 namespace kagome::runtime::wavm {
16  class MemoryImpl;
17 
19  public:
20  explicit WavmInternalMemoryProvider(WAVM::Runtime::Memory *memory);
21 
22  std::optional<std::reference_wrapper<runtime::Memory>> getCurrentMemory()
23  const override;
24  outcome::result<void> resetMemory(WasmSize heap_base) override;
25 
26  private:
27  WAVM::Runtime::Memory *memory_;
28  std::shared_ptr<Memory> current_memory_;
29  };
30 
31 } // namespace kagome::runtime::wavm
32 
33 #endif // KAGOME_CORE_RUNTIME_WAVM_IMPL_WAVM_MEMORY_PROVIDER_HPP
uint32_t WasmSize
Size type is uint32_t because we are working in 32 bit address space.
Definition: types.hpp:35