@@ -20,10 +20,10 @@ use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
2020use tracing:: { debug, instrument, trace} ;
2121
2222use super :: {
23- AllocBytes , AllocId , AllocMap , AllocRange , Allocation , CheckAlignMsg , CheckInAllocMsg ,
24- CtfeProvenance , GlobalAlloc , InterpCx , InterpResult , Machine , MayLeak , Misalignment , Pointer ,
25- PointerArithmetic , Provenance , Scalar , alloc_range, err_ub, err_ub_custom , interp_ok , throw_ub ,
26- throw_ub_custom, throw_unsup, throw_unsup_format,
23+ AllocBytes , AllocId , AllocInit , AllocMap , AllocRange , Allocation , CheckAlignMsg ,
24+ CheckInAllocMsg , CtfeProvenance , GlobalAlloc , InterpCx , InterpResult , Machine , MayLeak ,
25+ Misalignment , Pointer , PointerArithmetic , Provenance , Scalar , alloc_range, err_ub,
26+ err_ub_custom , interp_ok , throw_ub , throw_ub_custom, throw_unsup, throw_unsup_format,
2727} ;
2828use crate :: fluent_generated as fluent;
2929
@@ -230,12 +230,12 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
230230 size : Size ,
231231 align : Align ,
232232 kind : MemoryKind < M :: MemoryKind > ,
233- zero_init : bool ,
233+ init : AllocInit ,
234234 ) -> InterpResult < ' tcx , Pointer < M :: Provenance > > {
235235 let alloc = if M :: PANIC_ON_ALLOC_FAIL {
236- Allocation :: new ( size, align, zero_init )
236+ Allocation :: new ( size, align, init )
237237 } else {
238- Allocation :: try_new ( size, align, zero_init ) ?
238+ Allocation :: try_new ( size, align, init ) ?
239239 } ;
240240 self . insert_allocation ( alloc, kind)
241241 }
@@ -278,7 +278,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
278278 new_size : Size ,
279279 new_align : Align ,
280280 kind : MemoryKind < M :: MemoryKind > ,
281- zero_init : bool ,
281+ init : AllocInit ,
282282 ) -> InterpResult < ' tcx , Pointer < M :: Provenance > > {
283283 let ( alloc_id, offset, _prov) = self . ptr_get_alloc_id ( ptr, 0 ) ?;
284284 if offset. bytes ( ) != 0 {
@@ -291,7 +291,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
291291
292292 // For simplicities' sake, we implement reallocate as "alloc, copy, dealloc".
293293 // This happens so rarely, the perf advantage is outweighed by the maintenance cost.
294- let new_ptr = self . allocate_ptr ( new_size, new_align, kind, zero_init ) ?;
294+ let new_ptr = self . allocate_ptr ( new_size, new_align, kind, init ) ?;
295295 let old_size = match old_size_and_align {
296296 Some ( ( size, _align) ) => size,
297297 None => self . get_alloc_raw ( alloc_id) ?. size ( ) ,
0 commit comments