diff --git a/compiler/rustc_arena/src/lib.rs b/compiler/rustc_arena/src/lib.rs index 4d8525989cc59..3a3bf65e4f147 100644 --- a/compiler/rustc_arena/src/lib.rs +++ b/compiler/rustc_arena/src/lib.rs @@ -108,7 +108,7 @@ impl ArenaChunk { // we stop growing. This scales well, from arenas that are barely used up to // arenas that are used for 100s of MiBs. Note also that the chosen sizes match // the usual sizes of pages and huge pages on Linux. -const PAGE: usize = 4096; +const PAGE: usize = 65536; const HUGE_PAGE: usize = 2 * 1024 * 1024; /// An arena that can hold objects of only one type. diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 148b96181d1d2..ea880a25cc7e9 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -1207,6 +1207,9 @@ pub fn rustc_cargo_env( rustc_llvm_env(builder, cargo, target) } } + if builder.config.jemalloc { + cargo.env("JEMALLOC_SYS_WITH_LG_PAGE", "16"); + } } /// Pass down configuration from the LLVM build into the build of