Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mpk: add an example testing the memory limits (#7609)
* mpk: allow checking for MPK without a config instance It is inconvenient to have to construct a `PoolingAllocationConfig` in order to check if memory protection keys are available. This removes the unused `&self` restriction. * mpk: improve logging of calculated slab layout When double-checking the slab layout calculations it is quite convenient to see the total slab size. This helps in correlating with mapped regions. * mpk: add an example testing the memory limits This adds an example that can be run with `cargo run --example mpk`. Not only does the example demonstrate how to build a pool-allocated engine that uses MPK, it performs an exponential search to find the maximum number of slots the system can support, with and without MPK. * review: document Linux requirement * review: `env_logger::init` * review: replace `proc-maps` with manual parsing * vet: audit `bytesize` * fix: provide `main` for non-Linux systems * fix: move `cfg` to avoid unused code
- Loading branch information