Merge pull request #1690 from rtfeldman/mimalloc

Change the default roc allocator to mimalloc
This commit is contained in:
Richard Feldman 2021-09-11 22:52:33 -04:00 committed by GitHub
commit d09faad2c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 0 deletions

19
Cargo.lock generated
View file

@ -2026,6 +2026,15 @@ dependencies = [
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "libmimalloc-sys"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d1b8479c593dba88c2741fc50b92e13dbabbbe0bd504d979f244ccc1a5b1c01"
dependencies = [
"cc",
]
[[package]] [[package]]
name = "linked-hash-map" name = "linked-hash-map"
version = "0.5.4" version = "0.5.4"
@ -2170,6 +2179,15 @@ dependencies = [
"objc", "objc",
] ]
[[package]]
name = "mimalloc"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb74897ce508e6c49156fd1476fc5922cbc6e75183c65e399c765a09122e5130"
dependencies = [
"libmimalloc-sys",
]
[[package]] [[package]]
name = "minimal-lexical" name = "minimal-lexical"
version = "0.1.3" version = "0.1.3"
@ -3432,6 +3450,7 @@ dependencies = [
"libc", "libc",
"libloading 0.6.7", "libloading 0.6.7",
"maplit", "maplit",
"mimalloc",
"pretty_assertions 0.5.1", "pretty_assertions 0.5.1",
"quickcheck 0.8.5", "quickcheck 0.8.5",
"quickcheck_macros 0.8.0", "quickcheck_macros 0.8.0",

View file

@ -67,6 +67,7 @@ im-rc = "14" # im and im-rc should always have the same version!
bumpalo = { version = "3.2", features = ["collections"] } bumpalo = { version = "3.2", features = ["collections"] }
libc = "0.2" libc = "0.2"
libloading = "0.6" libloading = "0.6"
mimalloc = { version = "0.1.26", default-features = false }
inkwell = { path = "../vendor/inkwell", optional = true } inkwell = { path = "../vendor/inkwell", optional = true }
target-lexicon = "0.12.2" target-lexicon = "0.12.2"

View file

@ -6,6 +6,9 @@ use std::fs::{self, FileType};
use std::io; use std::io;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
#[cfg(feature = "llvm")] #[cfg(feature = "llvm")]
use roc_cli::build; use roc_cli::build;
use std::ffi::{OsStr, OsString}; use std::ffi::{OsStr, OsString};