[compiler-rt] [scudo] Use the releaseAndZeroPagesToOS function. (PR #71256)

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 17:04:07 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Christopher Ferris (cferris1000)

<details>
<summary>Changes</summary>

All of the code assumes that when the pages are released, the entry is zero'd, so use the correct function. On most systems, this does not change anything.

---
Full diff: https://github.com/llvm/llvm-project/pull/71256.diff


1 Files Affected:

- (modified) compiler-rt/lib/scudo/standalone/secondary.h (+2-2) 


``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h
index c89e6a95f5a68a4..8dc4c87fa7c6e99 100644
--- a/compiler-rt/lib/scudo/standalone/secondary.h
+++ b/compiler-rt/lib/scudo/standalone/secondary.h
@@ -223,7 +223,7 @@ template <typename Config> class MapAllocatorCache {
                                          MAP_NOACCESS);
       }
     } else if (Interval == 0) {
-      Entry.MemMap.releasePagesToOS(Entry.CommitBase, Entry.CommitSize);
+      Entry.MemMap.releaseAndZeroPagesToOS(Entry.CommitBase, Entry.CommitSize);
       Entry.Time = 0;
     }
     do {
@@ -441,7 +441,7 @@ template <typename Config> class MapAllocatorCache {
         OldestTime = Entry.Time;
       return;
     }
-    Entry.MemMap.releasePagesToOS(Entry.CommitBase, Entry.CommitSize);
+    Entry.MemMap.releaseAndZeroPagesToOS(Entry.CommitBase, Entry.CommitSize);
     Entry.Time = 0;
   }
 

``````````

</details>


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


More information about the llvm-commits mailing list