[compiler-rt] [scudo] Allow to resize allocation ring buffer (PR #82683)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 15:06:16 PST 2024


================
@@ -1564,11 +1570,11 @@ class Allocator {
                   UINTPTR_MAX);
 
     if (AllocationRingBufferSize > kMaxU32Pow2 / kStacksPerRingBufferEntry)
-      return;
+      return false;
     u32 TabSize = static_cast<u32>(roundUpPowerOfTwo(kStacksPerRingBufferEntry *
                                                      AllocationRingBufferSize));
     if (TabSize > UINT32_MAX / kFramesPerStack)
-      return;
+      return false;
     u32 RingSize = static_cast<u32>(TabSize * kFramesPerStack);
     DCHECK(isPowerOfTwo(RingSize));
----------------
fmayer wrote:

Sure (seems like clang knows to optimize this away anyway https://godbolt.org/z/GM6sKM5YE): https://github.com/llvm/llvm-project/pull/84255

https://github.com/llvm/llvm-project/pull/82683


More information about the llvm-commits mailing list