Skip to content

Commit

Permalink
set --disable-stats if stats feature is not enabled (#82)
Browse files Browse the repository at this point in the history
jemalloc defaults to enabling stats if `--enable-stats` is not
present and `--disable-stats` was not set: https://github.com/jemalloc/jemalloc/blob/fa451de17fff73cc03c31ec8cd817d62927d1ff9/configure.ac#L1331-L1333

the stats feature was always enabled by default and never
respected if someone were to remove the stats feature as
no logic was added for setting `--disable-stats`. to avoid
breaking other user's setups who are relying on this behaviour,
set stats as a default feature.

Signed-off-by: strawberry <[email protected]>
  • Loading branch information
girlbossceo authored May 10, 2024
1 parent 805804a commit 86e9248
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jemalloc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ libc = { version = "^0.2.8", default-features = false }
cc = "^1.0.13"

[features]
default = ["background_threads_runtime_support"]
default = ["stats", "background_threads_runtime_support"]
profiling = []
debug = []
background_threads_runtime_support = []
Expand Down
3 changes: 3 additions & 0 deletions jemalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ fn main() {
if env::var("CARGO_FEATURE_STATS").is_ok() {
info!("CARGO_FEATURE_STATS set");
cmd.arg("--enable-stats");
} else {
info!("CARGO_FEATURE_STATS not set");
cmd.arg("--disable-stats");
}

if env::var("CARGO_FEATURE_DISABLE_INITIAL_EXEC_TLS").is_ok() {
Expand Down
2 changes: 1 addition & 1 deletion jemallocator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ paste = "1"
tikv-jemalloc-ctl = { path = "../jemalloc-ctl", version = "0.5.0" }

[features]
default = ["background_threads_runtime_support"]
default = ["stats", "background_threads_runtime_support"]
alloc_trait = []
profiling = ["tikv-jemalloc-sys/profiling"]
debug = ["tikv-jemalloc-sys/debug"]
Expand Down

0 comments on commit 86e9248

Please sign in to comment.