From 7e95293b2944ce4a46f98c6a8f28670056d4bb97 Mon Sep 17 00:00:00 2001 From: Forest Anderson Date: Sun, 6 Oct 2019 07:19:53 -0400 Subject: [PATCH] Added modern instructions --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e392ff8..644c14e 100644 --- a/README.md +++ b/README.md @@ -25,16 +25,21 @@ To use `jemallocator` add it as a dependency: ```toml # Cargo.toml [dependencies] -jemallocator = "0.3.0" + +[target.'cfg(not(target_env = "msvc"))'.dependencies] +jemallocator = "0.3.2" ``` To set `jemallocator::Jemalloc` as the global allocator add this to your project: ```rust -extern crate jemallocator; +# main.rs +#[cfg(not(target_env = "msvc"))] +use jemallocator::Jemalloc; +#[cfg(not(target_env = "msvc"))] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static GLOBAL: Jemalloc = Jemalloc; ``` And that's it! Once you've defined this `static` then jemalloc will be used for