@@ -345,6 +345,7 @@ pub struct Config {
345
345
jemalloc : bool ,
346
346
#[ cfg( test) ]
347
347
pub jemalloc : bool ,
348
+ pub mimalloc : bool ,
348
349
pub control_flow_guard : bool ,
349
350
pub ehcont_guard : bool ,
350
351
@@ -663,6 +664,7 @@ pub struct Target {
663
664
pub codegen_backends : Option < Vec < String > > ,
664
665
pub optimized_compiler_builtins : Option < bool > ,
665
666
pub jemalloc : Option < bool > ,
667
+ pub mimalloc : Option < bool > ,
666
668
}
667
669
668
670
impl Target {
@@ -1225,6 +1227,7 @@ define_config! {
1225
1227
thin_lto_import_instr_limit: Option <u32 > = "thin-lto-import-instr-limit" ,
1226
1228
remap_debuginfo: Option <bool > = "remap-debuginfo" ,
1227
1229
jemalloc: Option <bool > = "jemalloc" ,
1230
+ mimalloc: Option <bool > = "mimalloc" ,
1228
1231
test_compare_mode: Option <bool > = "test-compare-mode" ,
1229
1232
llvm_libunwind: Option <String > = "llvm-libunwind" ,
1230
1233
control_flow_guard: Option <bool > = "control-flow-guard" ,
@@ -1267,6 +1270,7 @@ define_config! {
1267
1270
runner: Option <String > = "runner" ,
1268
1271
optimized_compiler_builtins: Option <bool > = "optimized-compiler-builtins" ,
1269
1272
jemalloc: Option <bool > = "jemalloc" ,
1273
+ mimalloc: Option <bool > = "mimalloc" ,
1270
1274
}
1271
1275
}
1272
1276
@@ -1891,6 +1895,7 @@ impl Config {
1891
1895
thin_lto_import_instr_limit,
1892
1896
remap_debuginfo,
1893
1897
jemalloc,
1898
+ mimalloc,
1894
1899
test_compare_mode,
1895
1900
llvm_libunwind,
1896
1901
control_flow_guard,
@@ -1963,6 +1968,7 @@ impl Config {
1963
1968
set ( & mut config. rust_frame_pointers , frame_pointers) ;
1964
1969
config. rust_stack_protector = stack_protector;
1965
1970
set ( & mut config. jemalloc , jemalloc) ;
1971
+ set ( & mut config. mimalloc , mimalloc) ;
1966
1972
set ( & mut config. test_compare_mode , test_compare_mode) ;
1967
1973
set ( & mut config. backtrace , backtrace) ;
1968
1974
if rust_description. is_some ( ) {
@@ -2230,6 +2236,7 @@ impl Config {
2230
2236
target. rpath = cfg. rpath ;
2231
2237
target. optimized_compiler_builtins = cfg. optimized_compiler_builtins ;
2232
2238
target. jemalloc = cfg. jemalloc ;
2239
+ target. mimalloc = cfg. mimalloc ;
2233
2240
2234
2241
if let Some ( ref backends) = cfg. codegen_backends {
2235
2242
let available_backends = [ "llvm" , "cranelift" , "gcc" ] ;
@@ -2811,6 +2818,10 @@ impl Config {
2811
2818
self . target_config . get ( & target) . and_then ( |cfg| cfg. jemalloc ) . unwrap_or ( self . jemalloc )
2812
2819
}
2813
2820
2821
+ pub fn mimalloc ( & self , target : TargetSelection ) -> bool {
2822
+ self . target_config . get ( & target) . and_then ( |cfg| cfg. mimalloc ) . unwrap_or ( self . mimalloc )
2823
+ }
2824
+
2814
2825
pub fn default_codegen_backend ( & self , target : TargetSelection ) -> Option < String > {
2815
2826
self . codegen_backends ( target) . first ( ) . cloned ( )
2816
2827
}
@@ -3374,6 +3385,7 @@ fn check_incompatible_options_for_ci_rustc(
3374
3385
strip,
3375
3386
lld_mode,
3376
3387
jemalloc,
3388
+ mimalloc,
3377
3389
rpath,
3378
3390
channel,
3379
3391
description,
@@ -3437,6 +3449,7 @@ fn check_incompatible_options_for_ci_rustc(
3437
3449
err ! ( current_rust_config. llvm_tools, llvm_tools, "rust" ) ;
3438
3450
err ! ( current_rust_config. llvm_bitcode_linker, llvm_bitcode_linker, "rust" ) ;
3439
3451
err ! ( current_rust_config. jemalloc, jemalloc, "rust" ) ;
3452
+ err ! ( current_rust_config. mimalloc, mimalloc, "rust" ) ;
3440
3453
err ! ( current_rust_config. default_linker, default_linker, "rust" ) ;
3441
3454
err ! ( current_rust_config. stack_protector, stack_protector, "rust" ) ;
3442
3455
err ! ( current_rust_config. lto, lto, "rust" ) ;
0 commit comments