[compiler-rt] [scudo] Support no-preserve-all-regions mode (PR #85149)

Fabio D'Urso via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 14:01:15 PDT 2024


================
@@ -87,9 +87,15 @@ PRIMARY_REQUIRED(const s32, MaxReleaseToOsIntervalMs)
 // PRIMARY_OPTIONAL(TYPE, NAME, DEFAULT)
 //
 // Indicates support for offsetting the start of a region by a random number of
-// pages. Only used with primary64.
+// pages. This is only used if `PreserveAllRegions` is enabled.
 PRIMARY_OPTIONAL(const bool, EnableRandomOffset, false)
 
+// When `PreserveAllRegions` is true, the virtual address for all regions will
+// be preserved within a big chunk of memory. This will reduce the fragmentation
+// caused by region allocations but may require a huge amount of contiguous
+// pages at initialization.
+PRIMARY_OPTIONAL(const bool, PreserveAllRegions, true)
----------------
fabio-d wrote:

As we discussed out of band, I think that `PreserveAllRegions` gives the impression that this option is about "protecting" the regions, while in fact it's about placing them next to each other to avoid fragmentation

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


More information about the llvm-commits mailing list