Auto merge of #138764 - Zoxc:win-mimalloc, r= · rust-lang/rust@b200834 (original) (raw)

`@@ -346,6 +346,7 @@ pub struct Config {

`

346

346

`jemalloc: bool,

`

347

347

`#[cfg(test)]

`

348

348

`pub jemalloc: bool,

`

``

349

`+

pub mimalloc: bool,

`

349

350

`pub control_flow_guard: bool,

`

350

351

`pub ehcont_guard: bool,

`

351

352

``

`@@ -666,6 +667,7 @@ pub struct Target {

`

666

667

`pub codegen_backends: Option<Vec>,

`

667

668

`pub optimized_compiler_builtins: Option,

`

668

669

`pub jemalloc: Option,

`

``

670

`+

pub mimalloc: Option,

`

669

671

`}

`

670

672

``

671

673

`impl Target {

`

`@@ -1228,6 +1230,7 @@ define_config! {

`

1228

1230

` thin_lto_import_instr_limit: Option = "thin-lto-import-instr-limit",

`

1229

1231

` remap_debuginfo: Option = "remap-debuginfo",

`

1230

1232

` jemalloc: Option = "jemalloc",

`

``

1233

`+

mimalloc: Option = "mimalloc",

`

1231

1234

` test_compare_mode: Option = "test-compare-mode",

`

1232

1235

` llvm_libunwind: Option = "llvm-libunwind",

`

1233

1236

` control_flow_guard: Option = "control-flow-guard",

`

`@@ -1270,6 +1273,7 @@ define_config! {

`

1270

1273

` runner: Option = "runner",

`

1271

1274

` optimized_compiler_builtins: Option = "optimized-compiler-builtins",

`

1272

1275

` jemalloc: Option = "jemalloc",

`

``

1276

`+

mimalloc: Option = "mimalloc",

`

1273

1277

`}

`

1274

1278

`}

`

1275

1279

``

`@@ -1895,6 +1899,7 @@ impl Config {

`

1895

1899

` thin_lto_import_instr_limit,

`

1896

1900

` remap_debuginfo,

`

1897

1901

` jemalloc,

`

``

1902

`+

mimalloc,

`

1898

1903

` test_compare_mode,

`

1899

1904

` llvm_libunwind,

`

1900

1905

` control_flow_guard,

`

`@@ -1967,6 +1972,7 @@ impl Config {

`

1967

1972

`set(&mut config.rust_frame_pointers, frame_pointers);

`

1968

1973

` config.rust_stack_protector = stack_protector;

`

1969

1974

`set(&mut config.jemalloc, jemalloc);

`

``

1975

`+

set(&mut config.mimalloc, mimalloc);

`

1970

1976

`set(&mut config.test_compare_mode, test_compare_mode);

`

1971

1977

`set(&mut config.backtrace, backtrace);

`

1972

1978

`if rust_description.is_some() {

`

`@@ -2234,6 +2240,7 @@ impl Config {

`

2234

2240

` target.rpath = cfg.rpath;

`

2235

2241

` target.optimized_compiler_builtins = cfg.optimized_compiler_builtins;

`

2236

2242

` target.jemalloc = cfg.jemalloc;

`

``

2243

`+

target.mimalloc = cfg.mimalloc;

`

2237

2244

``

2238

2245

`if let Some(ref backends) = cfg.codegen_backends {

`

2239

2246

`let available_backends = ["llvm", "cranelift", "gcc"];

`

`@@ -2815,6 +2822,10 @@ impl Config {

`

2815

2822

`self.target_config.get(&target).and_then(|cfg| cfg.jemalloc).unwrap_or(self.jemalloc)

`

2816

2823

`}

`

2817

2824

``

``

2825

`+

pub fn mimalloc(&self, target: TargetSelection) -> bool {

`

``

2826

`+

self.target_config.get(&target).and_then(|cfg| cfg.mimalloc).unwrap_or(self.mimalloc)

`

``

2827

`+

}

`

``

2828

+

2818

2829

`pub fn default_codegen_backend(&self, target: TargetSelection) -> Option {

`

2819

2830

`self.codegen_backends(target).first().cloned()

`

2820

2831

`}

`

`@@ -3392,6 +3403,7 @@ fn check_incompatible_options_for_ci_rustc(

`

3392

3403

` strip,

`

3393

3404

` lld_mode,

`

3394

3405

` jemalloc,

`

``

3406

`+

mimalloc,

`

3395

3407

` rpath,

`

3396

3408

` channel,

`

3397

3409

` description,

`

`@@ -3455,6 +3467,7 @@ fn check_incompatible_options_for_ci_rustc(

`

3455

3467

`err!(current_rust_config.llvm_tools, llvm_tools, "rust");

`

3456

3468

`err!(current_rust_config.llvm_bitcode_linker, llvm_bitcode_linker, "rust");

`

3457

3469

`err!(current_rust_config.jemalloc, jemalloc, "rust");

`

``

3470

`+

err!(current_rust_config.mimalloc, mimalloc, "rust");

`

3458

3471

`err!(current_rust_config.default_linker, default_linker, "rust");

`

3459

3472

`err!(current_rust_config.stack_protector, stack_protector, "rust");

`

3460

3473

`err!(current_rust_config.lto, lto, "rust");

`