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

Optionally make jemallocator register as a #[global_allocator] #88

Open
SimonSapin opened this Issue Nov 3, 2018 · 2 comments

Comments

2 participants
@SimonSapin
Contributor

SimonSapin commented Nov 3, 2018

Following up on https://internals.rust-lang.org/t/jemalloc-was-just-removed-from-the-standard-library/8759/10, it makes sense to me to add two Cargo features to this crate:

  • global_allocator_on_tested_platforms: define the #[global_allocator] with a cfg that only applies to targets this repository has CI for.
  • global_allocator: same, but unconditional. It might work on an untested platform.

CC @gnzlbg @sfackler @alexcrichton

@SimonSapin

This comment has been minimized.

Contributor

SimonSapin commented Nov 3, 2018

Hmm, I just realized that for the conditional one we probably don’t want to link to jemalloc-sys on untested platforms, so it might need to be a separate crate rather than a feature of jemallocator.

@gnzlbg

This comment has been minimized.

Collaborator

gnzlbg commented Nov 3, 2018

I think that we can put the global_allocator (unconditional) feature in jemallocator, but I think it might be worth it to do the "global_allocator_on_supported_platforms on a different crate, so that it only includes jemallocator (and therefore jemalloc-sys) in those platforms in which it is guaranteed to work, and the crate is "empty" otherwise. Bolting this logic onto jemallocator might get messy.

It makes sense to have this other crate in this repo, so that we can reuse all of the CI that's already set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment