@@ -20,10 +20,10 @@ use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
20
20
use tracing:: { debug, instrument, trace} ;
21
21
22
22
use 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,
27
27
} ;
28
28
use crate :: fluent_generated as fluent;
29
29
@@ -230,12 +230,12 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
230
230
size : Size ,
231
231
align : Align ,
232
232
kind : MemoryKind < M :: MemoryKind > ,
233
- zero_init : bool ,
233
+ init : AllocInit ,
234
234
) -> InterpResult < ' tcx , Pointer < M :: Provenance > > {
235
235
let alloc = if M :: PANIC_ON_ALLOC_FAIL {
236
- Allocation :: new ( size, align, zero_init )
236
+ Allocation :: new ( size, align, init )
237
237
} else {
238
- Allocation :: try_new ( size, align, zero_init ) ?
238
+ Allocation :: try_new ( size, align, init ) ?
239
239
} ;
240
240
self . insert_allocation ( alloc, kind)
241
241
}
@@ -278,7 +278,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
278
278
new_size : Size ,
279
279
new_align : Align ,
280
280
kind : MemoryKind < M :: MemoryKind > ,
281
- zero_init : bool ,
281
+ init : AllocInit ,
282
282
) -> InterpResult < ' tcx , Pointer < M :: Provenance > > {
283
283
let ( alloc_id, offset, _prov) = self . ptr_get_alloc_id ( ptr, 0 ) ?;
284
284
if offset. bytes ( ) != 0 {
@@ -291,7 +291,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
291
291
292
292
// For simplicities' sake, we implement reallocate as "alloc, copy, dealloc".
293
293
// 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 ) ?;
295
295
let old_size = match old_size_and_align {
296
296
Some ( ( size, _align) ) => size,
297
297
None => self . get_alloc_raw ( alloc_id) ?. size ( ) ,
0 commit comments