Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/examples/mpk-available.rs
1685 views
1
//! This example checks if memory protection keys (MPK) are available on the
2
//! current system using the
3
//! [`PoolingAllocationConfig::are_memory_protection_keys_available`] API.
4
5
use std::process::exit;
6
use wasmtime::*;
7
8
fn main() {
9
if PoolingAllocationConfig::are_memory_protection_keys_available() {
10
eprintln!("MPK is available");
11
exit(0);
12
} else {
13
eprintln!("MPK is not available");
14
exit(1);
15
}
16
}
17
18