Skip to content

Commit

Permalink
Merge pull request #112 from devnexen/no_thp_option
Browse files Browse the repository at this point in the history
  • Loading branch information
octavonce authored May 9, 2024
2 parents aa85bab + 4ecbdd5 commit de45b6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ override = ["libmimalloc-sys/override"]
debug = ["libmimalloc-sys/debug"]
debug_in_debug = ["libmimalloc-sys/debug_in_debug"]
local_dynamic_tls = ["libmimalloc-sys/local_dynamic_tls"]
no_thp = ["libmimalloc-sys/no_thp"]
1 change: 1 addition & 0 deletions libmimalloc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ override = []
extended = ["cty"]
arena = []
local_dynamic_tls = []
no_thp = []

# Show `extended` on docs.rs since it's the full API surface.
[package.metadata.docs.rs]
Expand Down
6 changes: 6 additions & 0 deletions libmimalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ fn main() {
}
}

if (target_os == "linux" || target_os == "android")
&& env::var_os("CARGO_FEATURE_NO_THP").is_some()
{
build.define("MI_NO_THP", "1");
}

if env::var_os("CARGO_FEATURE_DEBUG").is_some()
|| (env::var_os("CARGO_FEATURE_DEBUG_IN_DEBUG").is_some() && cfg!(debug_assertions))
{
Expand Down

0 comments on commit de45b6f

Please sign in to comment.