diff options
| author | Ralf Jung <post@ralfj.de> | 2025-03-12 18:23:33 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2025-03-12 18:35:40 +0100 |
| commit | 03c1b43d9ed36f5ba52c356ce685088e3838740d (patch) | |
| tree | 4091196bcf67475380db1311ed8d0512248ff7f3 /compiler/rustc_const_eval/src/interpret/memory.rs | |
| parent | 0998d4095b0f11061f78a3f9c77a87838a4c1cb7 (diff) | |
| download | rust-03c1b43d9ed36f5ba52c356ce685088e3838740d.tar.gz rust-03c1b43d9ed36f5ba52c356ce685088e3838740d.zip | |
minor interpret cleanups
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/memory.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/memory.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index e5af0673629..75726269a86 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -263,9 +263,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { M::GLOBAL_KIND.map(MemoryKind::Machine), "dynamically allocating global memory" ); - // We have set things up so we don't need to call `adjust_from_tcx` here, - // so we avoid copying the entire allocation contents. - let extra = M::init_alloc_extra(self, id, kind, alloc.size(), alloc.align)?; + // This cannot be merged with the `adjust_global_allocation` code path + // since here we have an allocation that already uses `M::Bytes`. + let extra = M::init_local_allocation(self, id, kind, alloc.size(), alloc.align)?; let alloc = alloc.with_extra(extra); self.memory.alloc_map.insert(id, (kind, alloc)); M::adjust_alloc_root_pointer(self, Pointer::from(id), Some(kind)) |
