Skip to content

Commit

Permalink
Fix for static_assert on size of PackagedHeader vs UnPackedHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
rgal committed Jan 28, 2021
1 parent 1f56ed6 commit 28d86c2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions compiler-rt/lib/scudo/standalone/chunk.h
Expand Up @@ -63,13 +63,14 @@ enum State : u8 { Available = 0, Allocated = 1, Quarantined = 2 };
typedef u64 PackedHeader;
// Update the 'Mask' constants to reflect changes in this structure.
struct UnpackedHeader {
uptr ClassId : 8;
u8 State : 2;
u64 ClassId : 8;
u64 State : 2;
// Origin if State == Allocated, or WasZeroed otherwise.
u8 OriginOrWasZeroed : 2;
uptr SizeOrUnusedBytes : 20;
uptr Offset : 16;
uptr Checksum : 16;
u64 OriginOrWasZeroed : 2;
u64 Origin : 2;
u64 SizeOrUnusedBytes : 20;
u64 Offset : 16;
u64 Checksum : 16;
};
typedef atomic_u64 AtomicPackedHeader;
static_assert(sizeof(UnpackedHeader) == sizeof(PackedHeader), "");
Expand Down

0 comments on commit 28d86c2

Please sign in to comment.