Add jemalloc feature for using jemalloc instead of default allocator#126
Add jemalloc feature for using jemalloc instead of default allocator#126MarkusPettersson98 wants to merge 2 commits into
jemalloc feature for using jemalloc instead of default allocator#126Conversation
dlon
left a comment
There was a problem hiding this comment.
@dlon reviewed 7 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on MarkusPettersson98).
Serock3
left a comment
There was a problem hiding this comment.
@Serock3 reviewed 7 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on MarkusPettersson98).
gotatun-cli/src/main.rs line 19 at r2 (raw file):
#[cfg(all( any(feature = "mimalloc", feature = "jemalloc"), not(all(feature = "mimalloc", feature = "jemalloc"))
Nit: I am unsure about this style of guards. You would not compile the module at all with all-features. If I ran cargo check --all-features I would expect to compile all code paths. In this case it's a single line module, so it's doesn't matter, but it might be worth considering in the general case.
MarkusPettersson98
left a comment
There was a problem hiding this comment.
@MarkusPettersson98 made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on Serock3).
gotatun-cli/src/main.rs line 19 at r2 (raw file):
Previously, Serock3 (Sebastian Holmin) wrote…
Nit: I am unsure about this style of guards. You would not compile the module at all with
all-features. If I rancargo check --all-featuresI would expect to compile all code paths. In this case it's a single line module, so it's doesn't matter, but it might be worth considering in the general case.
I agree, it's fugly and now how features are generally supposed to work but in practice jemalloc and mimalloc need to be mutually exclusive. The alternative would be to enable one over the other if both features are enabled, which I don't think is necessarily better.
This PR builds on top of #27 and provides the
jemallocfeature to use jemalloc as the global allocator.This change is