Skip to content

Commit 795cdf1

Browse files
authored
Merge pull request #1961 from CosmWasm/cacheoptions-new-1.5
Add CacheOptions::new (backport 1.5)
2 parents 89891f0 + dcb1e45 commit 795cdf1

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to
66

77
## [Unreleased]
88

9+
### Added
10+
11+
- cosmwasm-vm: Add constructor `CacheOptions::new`
12+
913
## [1.5.0] - 2023-10-31
1014

1115
### Added

packages/vm/src/cache.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,22 @@ pub struct CacheOptions {
6565
pub instance_memory_limit: Size,
6666
}
6767

68+
impl CacheOptions {
69+
pub fn new(
70+
base_dir: impl Into<PathBuf>,
71+
available_capabilities: impl Into<HashSet<String>>,
72+
memory_cache_size: Size,
73+
instance_memory_limit: Size,
74+
) -> Self {
75+
Self {
76+
base_dir: base_dir.into(),
77+
available_capabilities: available_capabilities.into(),
78+
memory_cache_size,
79+
instance_memory_limit,
80+
}
81+
}
82+
}
83+
6884
pub struct CacheInner {
6985
/// The directory in which the Wasm blobs are stored in the file system.
7086
wasm_path: PathBuf,

0 commit comments

Comments
 (0)