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

Fabio D'Urso via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 09:36:49 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) {
+          const FillContentsMode FillContents =
+              TSDRegistry.getDisableMemInit() ? NoFill
+                                              : Options.getFillContentsMode();
+          if (FillContents != NoFill) {
----------------
fabio-d wrote:

@ChiaHungDuan do you think we should add an `UNLIKELY` like the corresponding code in `initChunk()`?

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


More information about the llvm-commits mailing list