[compiler-rt] [scudo] Apply filling option when realloc grows a block in-place too (PR #93212)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 17:57:00 PDT 2024


================
@@ -565,6 +565,19 @@ class Allocator {
             storeSecondaryAllocationStackMaybe(Options, OldPtr, NewSize);
           }
         }
+
+        // If we've increased the size, fill the extra bytes.
+        if (NewSize > OldSize) {
----------------
ChiaHungDuan wrote:


I agree with the potential performance cost here. Note that both primary and secondary have the entire block filled (secondary prepares block with content filling, correct me if I'm wrong). And I like the solution, we do content filling only when it shrinks (don't need to check if it's primary or secondary)



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


More information about the llvm-commits mailing list