Skip to content

Commit 694f53a

Browse files
Update crate documentation on secure feature
1 parent de45b6f commit 694f53a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/lib.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313
//! static GLOBAL: MiMalloc = MiMalloc;
1414
//! ```
1515
//!
16-
//! ## Usage without secure mode
17-
//! By default this library builds mimalloc in secure mode. This means that
18-
//! heap allocations are encrypted, but this results in a 3% increase in overhead.
16+
//! ## Usage with secure mode
17+
//! Using secure mode adds guard pages,
18+
//! randomized allocation, encrypted free lists, etc. The performance penalty is usually
19+
//! around 10% according to [mimalloc's](https://github.com/microsoft/mimalloc)
20+
//! own benchmarks.
1921
//!
20-
//! To disable secure mode, in `Cargo.toml`:
22+
//! To enable secure mode, put in `Cargo.toml`:
2123
//! ```rust,ignore
2224
//! [dependencies]
23-
//! mimalloc = { version = "*", default-features = false }
25+
//! mimalloc = { version = "*", features = ["secure"] }
2426
//! ```
2527
2628
extern crate libmimalloc_sys as ffi;

0 commit comments

Comments
 (0)