fd icon indicating copy to clipboard operation
fd copied to clipboard

Set use-jemalloc conditionally instead of ignoring it for some targets

Open sertonix opened this issue 1 month ago • 2 comments

src/main.rs and Cargo.toml include a complex expression to not use jemalloc on some targets even when use-jemalloc has been set explicitly. As far as I can tell most of the cases where jemalloc is disabled is due to build failures. Since cargo can be configured to use a system provided jemalloc these build failures can be avoided on some targets (in my case on 32-bit musl and riscv64). Therefor it would be nice to conditionally have use-jemalloc in the default features instead of force disabling it on some targets.

sertonix avatar Oct 31 '25 13:10 sertonix

Unfortunately, it doesn't look like it is currently possible to enable features based on the target platform, see https://github.com/rust-lang/cargo/issues/1197

So I'm not sure how to do this without requiring specifying the jemalloc feature on all platforms.

tmccombs avatar Nov 04 '25 07:11 tmccombs

Thanks for taking a look! In that case there isn't really something that can be done on the fd side.

sertonix avatar Nov 05 '25 13:11 sertonix