Skip to content

Commit de45b6f

Browse files
authored
Merge pull request #112 from devnexen/no_thp_option
2 parents aa85bab + 4ecbdd5 commit de45b6f

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ override = ["libmimalloc-sys/override"]
3030
debug = ["libmimalloc-sys/debug"]
3131
debug_in_debug = ["libmimalloc-sys/debug_in_debug"]
3232
local_dynamic_tls = ["libmimalloc-sys/local_dynamic_tls"]
33+
no_thp = ["libmimalloc-sys/no_thp"]

libmimalloc-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ override = []
3333
extended = ["cty"]
3434
arena = []
3535
local_dynamic_tls = []
36+
no_thp = []
3637

3738
# Show `extended` on docs.rs since it's the full API surface.
3839
[package.metadata.docs.rs]

libmimalloc-sys/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ fn main() {
3232
}
3333
}
3434

35+
if (target_os == "linux" || target_os == "android")
36+
&& env::var_os("CARGO_FEATURE_NO_THP").is_some()
37+
{
38+
build.define("MI_NO_THP", "1");
39+
}
40+
3541
if env::var_os("CARGO_FEATURE_DEBUG").is_some()
3642
|| (env::var_os("CARGO_FEATURE_DEBUG_IN_DEBUG").is_some() && cfg!(debug_assertions))
3743
{

0 commit comments

Comments
 (0)