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 = [
1885
1885
" libc" ,
1886
1886
]
1887
1887
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
+
1888
1898
[[package ]]
1889
1899
name = " jobserver"
1890
1900
version = " 0.1.31"
@@ -3573,6 +3583,7 @@ name = "rustc_driver_impl"
3573
3583
version = " 0.0.0"
3574
3584
dependencies = [
3575
3585
" ctrlc" ,
3586
+ " jemallocator" ,
3576
3587
" libc" ,
3577
3588
" rustc_ast" ,
3578
3589
" rustc_ast_lowering" ,
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ features = ['unprefixed_malloc_on_supported_platforms']
27
27
28
28
[features ]
29
29
# tidy-alphabetical-start
30
- jemalloc = [' dep:jemalloc-sys' ]
30
+ jemalloc = [' dep:jemalloc-sys' , ' rustc_driver_impl/jemalloc ' ]
31
31
llvm = [' rustc_driver_impl/llvm' ]
32
32
max_level_info = [' rustc_driver_impl/max_level_info' ]
33
33
rustc_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 = [
68
68
ctrlc = " 3.4.4"
69
69
# tidy-alphabetical-end
70
70
71
+ [dependencies .jemallocator ]
72
+ version = " 0.5.4"
73
+ optional = true
74
+ features = [' unprefixed_malloc_on_supported_platforms' ]
75
+
71
76
[features ]
72
77
# tidy-alphabetical-start
78
+ jemalloc = [' dep:jemallocator' ]
73
79
llvm = [' rustc_interface/llvm' ]
74
80
max_level_info = [' rustc_log/max_level_info' ]
75
81
rustc_use_parallel_compiler = [
Original file line number Diff line number Diff line change @@ -1575,6 +1575,14 @@ pub fn install_ctrlc_handler() {
1575
1575
}
1576
1576
1577
1577
pub fn main( ) -> ! {
1578
+ #[ cfg( feature = "jemalloc" ) ]
1579
+ {
1580
+ use jemallocator:: Jemalloc ;
1581
+
1582
+ #[ global_allocator]
1583
+ static GLOBAL : Jemalloc = Jemalloc ;
1584
+ }
1585
+
1578
1586
let start_time = Instant :: now( ) ;
1579
1587
let start_rss = get_resident_set_size( ) ;
1580
1588
Original file line number Diff line number Diff line change @@ -318,6 +318,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
318
318
"itertools" ,
319
319
"itoa" ,
320
320
"jemalloc-sys" ,
321
+ "jemallocator" ,
321
322
"jobserver" ,
322
323
"lazy_static" ,
323
324
"leb128" ,
You can’t perform that action at this time.
0 commit comments