Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only enable jemalloc on non-windows targets #857

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tzemanovic
Copy link

@tzemanovic tzemanovic commented Jan 29, 2024

hi, I'd like to use "jemalloc" on non-windows platforms using an optional feature in my app, but it's currently not possible to declare platform specific features in Cargo.toml (rust-lang/cargo#1197). To workaround it, I'd like to change librocksdb-sys to allow to use "jemalloc" on windows but without having any effect.

Edit: the reason "jemalloc" doesn't compile on windows is that https://crates.io/crates/tikv-jemallocator doesn't support it (tikv/jemallocator#22)

@@ -206,14 +206,14 @@ fn build_rocksdb() {
"port/win/win_logger.cc",
]);

if cfg!(feature = "jemalloc") {
if cfg!(all(feature = "jemalloc", not(windows))) {
lib_sources.push("port/win/win_jemalloc.cc");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it. Why do we need to add a source file related to the windows on not(windows) target?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah good point, this is pointless

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just removed this port c195c31

@tzemanovic tzemanovic force-pushed the tomas/no-jemalloc-win branch from c195c31 to abdfd87 Compare January 14, 2025 15:59
@tzemanovic tzemanovic force-pushed the tomas/no-jemalloc-win branch from abdfd87 to 5787324 Compare January 14, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants