Kagome
Polkadot Runtime Engine in C++17
kagome::runtime::wavm::ModuleCache Struct Reference

#include <module_cache.hpp>

Inheritance diagram for kagome::runtime::wavm::ModuleCache:
Collaboration diagram for kagome::runtime::wavm::ModuleCache:

Public Member Functions

 ModuleCache (std::shared_ptr< crypto::Hasher > hasher, fs::path cache_dir)
 
std::vector< WAVM::U8 > getCachedObject (const WAVM::U8 *wasmBytes, WAVM::Uptr numWASMBytes, std::function< std::vector< WAVM::U8 >()> &&compileThunk) override
 

Private Attributes

fs::path cache_dir_
 
std::shared_ptr< crypto::Hasherhasher_
 
log::Logger logger_
 

Detailed Description

WAVM runtime cache. Attempts to fetch precompiled module from fs and saves compiled module upon cache miss.

Definition at line 27 of file module_cache.hpp.

Constructor & Destructor Documentation

kagome::runtime::wavm::ModuleCache::ModuleCache ( std::shared_ptr< crypto::Hasher hasher,
fs::path  cache_dir 
)

Definition at line 14 of file module_cache.cpp.

Member Function Documentation

std::vector< WAVM::U8 > kagome::runtime::wavm::ModuleCache::getCachedObject ( const WAVM::U8 *  wasmBytes,
WAVM::Uptr  numWASMBytes,
std::function< std::vector< WAVM::U8 >()> &&  compileThunk 
)
override

Definition at line 22 of file module_cache.cpp.

Member Data Documentation

fs::path kagome::runtime::wavm::ModuleCache::cache_dir_
private

Definition at line 37 of file module_cache.hpp.

std::shared_ptr<crypto::Hasher> kagome::runtime::wavm::ModuleCache::hasher_
private

Definition at line 38 of file module_cache.hpp.

log::Logger kagome::runtime::wavm::ModuleCache::logger_
private

Definition at line 39 of file module_cache.hpp.


The documentation for this struct was generated from the following files: