File tree Expand file tree Collapse file tree 5 files changed +27
-1
lines changed Expand file tree Collapse file tree 5 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -1885,6 +1885,16 @@ dependencies = [
18851885 " libc" ,
18861886]
18871887
1888+ [[package ]]
1889+ name = " jemallocator"
1890+ version = " 0.5.4"
1891+ source = " registry+https://github.com/rust-lang/crates.io-index"
1892+ checksum = " a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc"
1893+ dependencies = [
1894+ " jemalloc-sys" ,
1895+ " libc" ,
1896+ ]
1897+
18881898[[package ]]
18891899name = " jobserver"
18901900version = " 0.1.31"
@@ -3573,6 +3583,7 @@ name = "rustc_driver_impl"
35733583version = " 0.0.0"
35743584dependencies = [
35753585 " ctrlc" ,
3586+ " jemallocator" ,
35763587 " libc" ,
35773588 " rustc_ast" ,
35783589 " rustc_ast_lowering" ,
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ features = ['unprefixed_malloc_on_supported_platforms']
2727
2828[features ]
2929# tidy-alphabetical-start
30- jemalloc = [' dep:jemalloc-sys' ]
30+ jemalloc = [' dep:jemalloc-sys' , ' rustc_driver_impl/jemalloc ' ]
3131llvm = [' rustc_driver_impl/llvm' ]
3232max_level_info = [' rustc_driver_impl/max_level_info' ]
3333rustc_use_parallel_compiler = [' rustc_driver_impl/rustc_use_parallel_compiler' ]
Original file line number Diff line number Diff line change @@ -68,8 +68,14 @@ features = [
6868ctrlc = " 3.4.4"
6969# tidy-alphabetical-end
7070
71+ [dependencies .jemallocator ]
72+ version = " 0.5.4"
73+ optional = true
74+ features = [' unprefixed_malloc_on_supported_platforms' ]
75+
7176[features ]
7277# tidy-alphabetical-start
78+ jemalloc = [' dep:jemallocator' ]
7379llvm = [' rustc_interface/llvm' ]
7480max_level_info = [' rustc_log/max_level_info' ]
7581rustc_use_parallel_compiler = [
Original file line number Diff line number Diff line change @@ -1575,6 +1575,14 @@ pub fn install_ctrlc_handler() {
15751575}
15761576
15771577pub fn main( ) -> ! {
1578+ #[ cfg( feature = "jemalloc" ) ]
1579+ {
1580+ use jemallocator:: Jemalloc ;
1581+
1582+ #[ global_allocator]
1583+ static GLOBAL : Jemalloc = Jemalloc ;
1584+ }
1585+
15781586 let start_time = Instant :: now( ) ;
15791587 let start_rss = get_resident_set_size( ) ;
15801588
Original file line number Diff line number Diff line change @@ -318,6 +318,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
318318 "itertools" ,
319319 "itoa" ,
320320 "jemalloc-sys" ,
321+ "jemallocator" ,
321322 "jobserver" ,
322323 "lazy_static" ,
323324 "leb128" ,
You can’t perform that action at this time.
0 commit comments