Skip to content

Commit

Permalink
Making jemalloc an optional feature
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schildt <[email protected]>
  • Loading branch information
SebastianSchildt committed Jan 27, 2023
1 parent b12b77c commit 75446da
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions kuksa_databroker/databroker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ sqlparser = "0.16.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.jemallocator]
version = "0.5.0"
jemallocator = { version = "0.5.0", optional = true }

[features]
# to enable jemalloc use --features jemalloc
jemalloc = ["dep:jemallocator"]


[build-dependencies]
anyhow = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion kuksa_databroker/databroker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

#[cfg(all(target_env = "musl", target_pointer_width = "64"))]
#[cfg(feature = "jemalloc")]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

Expand Down

0 comments on commit 75446da

Please sign in to comment.