Refactor configuration for the pooling allocator (#5205)
This commit changes the APIs in the `wasmtime` crate for configuring the pooling allocator. I plan on adding a few more configuration options in the near future and the current structure was feeling unwieldy for adding these new abstractions. The previous `struct`-based API has been replaced with a builder-style API in a similar shape as to `Config`. This is done to help make it easier to add more configuration options in the future through adding more methods as opposed to adding more field which could break prior initializations.
This commit is contained in:
@@ -202,13 +202,11 @@ fn bench_instantiation(c: &mut Criterion) {
|
||||
fn strategies() -> impl Iterator<Item = InstanceAllocationStrategy> {
|
||||
[
|
||||
InstanceAllocationStrategy::OnDemand,
|
||||
InstanceAllocationStrategy::Pooling {
|
||||
strategy: Default::default(),
|
||||
instance_limits: InstanceLimits {
|
||||
memory_pages: 10_000,
|
||||
..Default::default()
|
||||
},
|
||||
},
|
||||
InstanceAllocationStrategy::Pooling({
|
||||
let mut config = PoolingAllocationConfig::default();
|
||||
config.instance_memory_pages(10_000);
|
||||
config
|
||||
}),
|
||||
]
|
||||
.into_iter()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user