-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Description
Once the #[global_allocator] attribute and the GlobalAlloc trait are stable (#49668), we plan to make the system allocator the default for executables instead of jemalloc, and remove jemalloc from the standard library: #36963 / #27389.
Presumably, we want rustc to keep using jemalloc since it often performs better, for rustc’s typical workload. Like other programs, it can do so using #[global_allocator] and the jemallocator crate or similar. (And make jemalloc symbols be unprefixed so that they get picked up by LLVM too, but I don’t forsee a difficulty adding a Cargo feature to jemallocator for this.)
However, per #45966 (comment) this might not work because rustc itself is compiled with -C prefer-dynamic and links to the standard library dynamically.
@alexcrichton, are -C prefer-dynamic and #[global_allocator] fundamentally incompatible or is this something we can fix? Is it possible to make rustc not use -C prefer-dynamic?
CC @gnzlbg, @rust-lang/compiler