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

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 12:46:42 PST 2023


Author: Christopher Ferris
Date: 2023-11-06T12:46:37-08:00
New Revision: e15fcd7ba41e63edc7da217f0b33aeb10f1c0b5a

URL: https://github.com/llvm/llvm-project/commit/e15fcd7ba41e63edc7da217f0b33aeb10f1c0b5a
DIFF: https://github.com/llvm/llvm-project/commit/e15fcd7ba41e63edc7da217f0b33aeb10f1c0b5a.diff

LOG: [scudo] Use the releaseAndZeroPagesToOS function. (#71256)

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.

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/secondary.h

Removed: 
    


################################################################################
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;
   }
 


        


More information about the llvm-commits mailing list