Skip to content

Commit 1a4754c

Browse files
authored
[NFC] turn comment into static_assert (#71504)
1 parent d3fb05b commit 1a4754c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_ring_buffer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ class RingBuffer {
4747
void push(T t) {
4848
*next_ = t;
4949
next_--;
50-
// The condition below works only if sizeof(T) is divisible by sizeof(T*).
50+
static_assert((sizeof(T) % sizeof(T *)) == 0,
51+
"The condition below works only if sizeof(T) is divisible by "
52+
"sizeof(T*).");
5153
if (next_ <= reinterpret_cast<T*>(&next_))
5254
next_ = last_;
5355
}

0 commit comments

Comments
 (0)