diff options
author | Chris Robinson <[email protected]> | 2023-12-15 10:00:23 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-12-15 10:00:23 -0800 |
commit | 1381a951bea78c67281a2e844e6db1dedbd5ed7c (patch) | |
tree | f28069ff1d7742aa8dc648d2d21ad4f2e69a58ef /common/ringbuffer.cpp | |
parent | ea5628061c4bc3a121f7f8e6448c037f425e6a7d (diff) |
Properly check if size_t is larger than uint32_t
Diffstat (limited to 'common/ringbuffer.cpp')
-rw-r--r-- | common/ringbuffer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/ringbuffer.cpp b/common/ringbuffer.cpp index 13db7eba..96a2b615 100644 --- a/common/ringbuffer.cpp +++ b/common/ringbuffer.cpp @@ -42,7 +42,7 @@ RingBufferPtr RingBuffer::Create(std::size_t sz, std::size_t elem_sz, int limit_ power_of_two |= power_of_two>>4; power_of_two |= power_of_two>>8; power_of_two |= power_of_two>>16; - if constexpr(std::numeric_limits<size_t>::max() > std::numeric_limits<int32_t>::max()) + if constexpr(sizeof(size_t) > sizeof(uint32_t)) power_of_two |= power_of_two>>32; } ++power_of_two; |