Kagome
Polkadot Runtime Engine in C++17
memory_extension.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_MEMORY_EXTENSIONS_HPP
7 #define KAGOME_MEMORY_EXTENSIONS_HPP
8 
9 #include "log/logger.hpp"
10 #include "runtime/types.hpp"
11 
12 namespace kagome::runtime {
13  class MemoryProvider;
14 }
15 
16 namespace kagome::host_api {
22  public:
23  explicit MemoryExtension(
24  std::shared_ptr<const runtime::MemoryProvider> memory_provider);
25 
26  // ----------------- memory api v1 -----------------
30  runtime::WasmPointer ext_allocator_malloc_version_1(runtime::WasmSize size);
31 
35  void ext_allocator_free_version_1(runtime::WasmPointer ptr);
36 
37  private:
38  std::shared_ptr<const runtime::MemoryProvider> memory_provider_;
40  };
41 } // namespace kagome::host_api
42 
43 #endif // KAGOME_MEMORY_EXTENSIONS_HPP
uint32_t WasmSize
Size type is uint32_t because we are working in 32 bit address space.
Definition: types.hpp:35
std::shared_ptr< soralog::Logger > Logger
Definition: logger.hpp:23
uint32_t WasmPointer
type of wasm memory is 32 bit integer
Definition: types.hpp:26
std::shared_ptr< const runtime::MemoryProvider > memory_provider_