diff options
| author | SpecificProtagonist <specificprotagonist@posteo.org> | 2025-01-25 00:54:51 +0100 |
|---|---|---|
| committer | SpecificProtagonist <specificprotagonist@posteo.org> | 2025-01-28 12:50:02 +0100 |
| commit | eee9df43e69e9841aaaa9bd4eae9f600a81f20b1 (patch) | |
| tree | ecb48bd31a0ad47f79c23f0c8669ec0f991c1b70 /compiler/rustc_const_eval/src/const_eval | |
| parent | 8231e8599e238ff4e717639bd68c6abb8579fe8d (diff) | |
| download | rust-eee9df43e69e9841aaaa9bd4eae9f600a81f20b1.tar.gz rust-eee9df43e69e9841aaaa9bd4eae9f600a81f20b1.zip | |
miri: optimize zeroed alloc
Co-authored-by: Ralf Jung <post@ralfj.de>
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/machine.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index cfdfbdb7880..6a339d69542 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -21,9 +21,10 @@ use super::error::*; use crate::errors::{LongRunning, LongRunningWarn}; use crate::fluent_generated as fluent; use crate::interpret::{ - self, AllocId, AllocRange, ConstAllocation, CtfeProvenance, FnArg, Frame, GlobalAlloc, ImmTy, - InterpCx, InterpResult, MPlaceTy, OpTy, RangeSet, Scalar, compile_time_machine, interp_ok, - throw_exhaust, throw_inval, throw_ub, throw_ub_custom, throw_unsup, throw_unsup_format, + self, AllocId, AllocInit, AllocRange, ConstAllocation, CtfeProvenance, FnArg, Frame, + GlobalAlloc, ImmTy, InterpCx, InterpResult, MPlaceTy, OpTy, RangeSet, Scalar, + compile_time_machine, interp_ok, throw_exhaust, throw_inval, throw_ub, throw_ub_custom, + throw_unsup, throw_unsup_format, }; /// When hitting this many interpreted terminators we emit a deny by default lint @@ -420,6 +421,7 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> { Size::from_bytes(size), align, interpret::MemoryKind::Machine(MemoryKind::Heap), + AllocInit::Uninit, )?; ecx.write_pointer(ptr, dest)?; } |
