bytecodealliance / wasmtime

A fast and secure runtime for WebAssembly
https://wasmtime.dev/
Apache License 2.0
15.21k stars 1.28k forks source link

Statically disable MPK without the pooling allocator #8794

Closed alexcrichton closed 3 months ago

alexcrichton commented 3 months ago

When the pooling allocator is itself disabled then there's no use for enabling MPK so this commit switches the implementation to all of the disabled versions of the primitives. This notably makes ProtectionKey an uninhabited enum meaning that Option<ProtectionKey> in the Store is a zero-sized field and .is_none() returns a constant true. This is on the hot path of entering/exiting wasm so can help speed up things a bit there.