give sychronous ResourceLimiter an async alternative
This commit is contained in:
@@ -300,7 +300,6 @@ impl ResourceLimiter for MemoryContext {
|
||||
self.wasm_memory_used = desired;
|
||||
true
|
||||
}
|
||||
|
||||
fn table_growing(&mut self, _current: u32, _desired: u32, _maximum: Option<u32>) -> bool {
|
||||
true
|
||||
}
|
||||
@@ -401,11 +400,9 @@ impl ResourceLimiter for MemoryGrowFailureDetector {
|
||||
self.desired = desired;
|
||||
true
|
||||
}
|
||||
|
||||
fn memory_grow_failed(&mut self, err: &anyhow::Error) {
|
||||
self.error = Some(err.to_string());
|
||||
}
|
||||
|
||||
fn table_growing(&mut self, _current: u32, _desired: u32, _maximum: Option<u32>) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
@@ -311,12 +311,16 @@ fn massive_64_bit_still_limited() -> Result<()> {
|
||||
}
|
||||
|
||||
impl ResourceLimiter for MyLimiter {
|
||||
fn memory_growing(&mut self, _request: usize, _min: usize, _max: Option<usize>) -> bool {
|
||||
fn memory_growing(
|
||||
&mut self,
|
||||
_current: usize,
|
||||
_request: usize,
|
||||
_max: Option<usize>,
|
||||
) -> bool {
|
||||
self.hit = true;
|
||||
true
|
||||
}
|
||||
|
||||
fn table_growing(&mut self, _request: u32, _min: u32, _max: Option<u32>) -> bool {
|
||||
fn table_growing(&mut self, _current: u32, _request: u32, _max: Option<u32>) -> bool {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,9 @@ impl ResourceLimiter for MemoryGrowFailureDetector {
|
||||
self.desired = desired;
|
||||
true
|
||||
}
|
||||
|
||||
fn memory_grow_failed(&mut self, err: &anyhow::Error) {
|
||||
self.error = Some(err.to_string());
|
||||
}
|
||||
|
||||
fn table_growing(&mut self, _current: u32, _desired: u32, _maximum: Option<u32>) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user