[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
Thu May 23 10:21:41 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) {
----------------
ChiaHungDuan wrote:

It's fine to leave it as it is. The UNLIKELY in initChunk may better to be removed as well but I'll check it later

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


More information about the llvm-commits mailing list