[NFC] [scudo] move static_assert closer to class it relates to (#84257)
delete other static_assert
This commit is contained in:
parent
8846b91e15
commit
b4e0890458
@ -1553,16 +1553,6 @@ private:
|
||||
constexpr u32 kFramesPerStack = 16;
|
||||
static_assert(isPowerOfTwo(kFramesPerStack));
|
||||
|
||||
// We need StackDepot to be aligned to 8-bytes so the ring we store after
|
||||
// is correctly assigned.
|
||||
static_assert(sizeof(StackDepot) % alignof(atomic_u64) == 0);
|
||||
|
||||
// Make sure the maximum sized StackDepot fits withint a uintptr_t to
|
||||
// simplify the overflow checking.
|
||||
static_assert(sizeof(StackDepot) + UINT32_MAX * sizeof(atomic_u64) *
|
||||
UINT32_MAX * sizeof(atomic_u32) <
|
||||
UINTPTR_MAX);
|
||||
|
||||
if (AllocationRingBufferSize > kMaxU32Pow2 / kStacksPerRingBufferEntry)
|
||||
return;
|
||||
u32 TabSize = static_cast<u32>(roundUpPowerOfTwo(kStacksPerRingBufferEntry *
|
||||
|
||||
@ -199,6 +199,10 @@ public:
|
||||
void enable() NO_THREAD_SAFETY_ANALYSIS { RingEndMu.unlock(); }
|
||||
};
|
||||
|
||||
// We need StackDepot to be aligned to 8-bytes so the ring we store after
|
||||
// is correctly assigned.
|
||||
static_assert(sizeof(StackDepot) % alignof(atomic_u64) == 0);
|
||||
|
||||
} // namespace scudo
|
||||
|
||||
#endif // SCUDO_STACK_DEPOT_H_
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user