Change MaxMemorySize to MaxMemoryPages (#6728)

* Change `MaxMemorySize` to `MaxMemoryPages`

We should set the max memory for the executor in pages (64KiB) and not in bytes.
The wasm memory is always a multiple of a page and we should use the
same terminology.

* FMT

* Fix warning
This commit is contained in:
Bastian Köcher
2023-02-16 17:10:24 +01:00
committed by GitHub
parent d5a7991429
commit 83eb8453eb
2 changed files with 5 additions and 5 deletions
+2 -1
View File
@@ -118,9 +118,10 @@ fn params_to_wasmtime_semantics(par: ExecutorParams) -> Result<Semantics, String
} else {
return Err("No default stack limit set".to_owned())
};
for p in par.iter() {
match p {
ExecutorParam::MaxMemorySize(mms) => sem.max_memory_size = Some(*mms as usize),
ExecutorParam::MaxMemoryPages(mms) => sem.max_memory_size = Some(*mms as usize * 65536),
ExecutorParam::StackLogicalMax(slm) => stack_limit.logical_max = *slm,
ExecutorParam::StackNativeMax(snm) => stack_limit.native_stack_max = *snm,
ExecutorParam::PrecheckingMaxMemory(_) => (), // TODO: Not implemented yet