From 694f53ae6dfd68b8540278cec5e2ed9cb4e3ec5a Mon Sep 17 00:00:00 2001 From: Nathaniel Daniel Date: Thu, 16 May 2024 17:31:29 -0700 Subject: [PATCH] Update crate documentation on secure feature --- src/lib.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8943907..281385f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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;