Skip to content

Commit 337a200

Browse files
authored
[NFC] [scudo] Move static_assert to class it concerns (#84245)
1 parent a8eb2f0 commit 337a200

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

compiler-rt/lib/scudo/standalone/combined.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,11 @@ class Allocator {
10811081
// An array of Size (at least one) elements of type Entry is immediately
10821082
// following to this struct.
10831083
};
1084+
static_assert(sizeof(AllocationRingBuffer) %
1085+
alignof(typename AllocationRingBuffer::Entry) ==
1086+
0,
1087+
"invalid alignment");
1088+
10841089
// Pointer to memory mapped area starting with AllocationRingBuffer struct,
10851090
// and immediately followed by Size elements of type Entry.
10861091
atomic_uptr RingBufferAddress = {};
@@ -1585,10 +1590,6 @@ class Allocator {
15851590

15861591
atomic_store(&RingBufferAddress, reinterpret_cast<uptr>(RB),
15871592
memory_order_release);
1588-
static_assert(sizeof(AllocationRingBuffer) %
1589-
alignof(typename AllocationRingBuffer::Entry) ==
1590-
0,
1591-
"invalid alignment");
15921593
}
15931594

15941595
void unmapRingBuffer() {

0 commit comments

Comments
 (0)