[compiler-rt] [scudo] Add EnableMultiRegions mode (PR #98076)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 12:14:25 PDT 2024


================
@@ -408,15 +545,20 @@ template <typename Config> class SizeClassAllocator64 {
   }
 
   uptr tryReleaseToOS(uptr ClassId, ReleaseToOS ReleaseType) {
-    RegionInfo *Region = getRegionInfo(ClassId);
-    // Note that the tryLock() may fail spuriously, given that it should rarely
-    // happen and page releasing is fine to skip, we don't take certain
-    // approaches to ensure one page release is done.
-    if (Region->MMLock.tryLock()) {
-      uptr BytesReleased = releaseToOSMaybe(Region, ClassId, ReleaseType);
-      Region->MMLock.unlock();
-      return BytesReleased;
-    }
+    auto RegionInfoIter = RegionInfoManager.getRegionInfoIter(ClassId);
+
+    do {
+      // Note that the tryLock() may fail spuriously, given that it should
----------------
ChiaHungDuan wrote:

Change the description to what you suggested and with minor change in the end. Which is
```
... there is no need to do anything to force at least `releaseToOSMaybe()` is called().
```


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


More information about the llvm-commits mailing list