Skip to content

Commit

Permalink
Update crate documentation on secure feature
Browse files Browse the repository at this point in the history
  • Loading branch information
nathaniel-daniel committed May 17, 2024
1 parent de45b6f commit 694f53a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
//! static GLOBAL: MiMalloc = MiMalloc;
//! ```
//!
//! ## Usage without secure mode
//! By default this library builds mimalloc in secure mode. This means that
//! heap allocations are encrypted, but this results in a 3% increase in overhead.
//! ## Usage with secure mode
//! Using secure mode adds guard pages,
//! randomized allocation, encrypted free lists, etc. The performance penalty is usually
//! around 10% according to [mimalloc's](https://github.com/microsoft/mimalloc)
//! own benchmarks.
//!
//! To disable secure mode, in `Cargo.toml`:
//! To enable secure mode, put in `Cargo.toml`:
//! ```rust,ignore
//! [dependencies]
//! mimalloc = { version = "*", default-features = false }
//! mimalloc = { version = "*", features = ["secure"] }
//! ```
extern crate libmimalloc_sys as ffi;
Expand Down

0 comments on commit 694f53a

Please sign in to comment.