-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Open
Labels
A-layoutArea: Memory layout of typesArea: Memory layout of typesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The Provenance type defined here is 24 bytes in size:
use std::num::NonZeroU64;
pub enum Provenance {
Concrete {
alloc_id: NonZeroU64,
sb: NonZeroU64,
},
Wildcard,
None,
}However, it should be possible to encode Provenance in 16 bytes: e.g. (0usize, 0suize) could encode None and (0usize, 1usize) could encode Wildcard.
In Miri, a slight variant of this would help reduce the size of a fairly common type from 32 bytes to 24 bytes.
Unfortunately even #94075 does not help here. The entire concept of reading a single field to determine the discriminant is not flexible enough to represent this layout.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-layoutArea: Memory layout of typesArea: Memory layout of typesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.