1
Fork 0

Rollup merge of #134055 - RalfJung:interpret-alloc-dedup, r=oli-obk

interpret: clean up deduplicating allocation functions

The "align" and "kind" arguments would be largely ignored in the "dedup" case, so let's move that to entirely separate function.

Let's also remove support for old-style miri_resolve_frame while we are at it. The docs have already said for a while that this must be set to 1.
This commit is contained in:
León Orell Valerian Liehr 2024-12-09 23:39:07 +01:00 committed by GitHub
commit e0bec9dabb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 23 additions and 137 deletions

View file

@ -1479,7 +1479,7 @@ impl<'tcx> TyCtxt<'tcx> {
self.mk_adt_def_from_data(ty::AdtDefData::new(self, did, kind, variants, repr))
}
/// Allocates a read-only byte or string literal for `mir::interpret`.
/// Allocates a read-only byte or string literal for `mir::interpret` with alignment 1.
/// Returns the same `AllocId` if called again with the same bytes.
pub fn allocate_bytes_dedup(self, bytes: &[u8], salt: usize) -> interpret::AllocId {
// Create an allocation that just contains these bytes.