mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
we no longer care where a tag layout stores the tag id
This commit is contained in:
parent
e95d093461
commit
48e6ef79a4
1 changed files with 2 additions and 13 deletions
|
@ -1122,7 +1122,6 @@ Struct to to check whether two reuse layouts are interchangeable.
|
|||
*/
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
struct TokenLayout {
|
||||
has_tag: bool,
|
||||
size: u32,
|
||||
alignment: u32,
|
||||
}
|
||||
|
@ -1416,16 +1415,6 @@ fn get_reuse_layout_info<'a, 'i>(
|
|||
union_layout: UnionLayout<'a>,
|
||||
) -> TokenLayout {
|
||||
let (size, alignment) = union_layout.data_size_and_alignment(layout_interner);
|
||||
let has_tag = match union_layout {
|
||||
UnionLayout::NonRecursive(_) => unreachable!("Non recursive unions should not be reused."),
|
||||
// The memory for union layouts that has a tag_id can be reused for new allocations with tag_id.
|
||||
UnionLayout::Recursive(_) | UnionLayout::NullableWrapped { .. } => true,
|
||||
// The memory for union layouts that have no tag_id can be reused for new allocations without tag_id
|
||||
UnionLayout::NonNullableUnwrapped(_) | UnionLayout::NullableUnwrapped { .. } => false,
|
||||
};
|
||||
TokenLayout {
|
||||
has_tag,
|
||||
size,
|
||||
alignment,
|
||||
}
|
||||
|
||||
TokenLayout { size, alignment }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue