[compiler-rt] [scudo] Don't preserve space for regions at init() (DO NOT MERGE) (PR #74531)
Christopher Ferris via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 11 13:24:00 PST 2023
================
@@ -982,6 +999,21 @@ template <typename Config> class SizeClassAllocator64 {
const uptr Size = getSizeByClassId(ClassId);
const u16 MaxCount = CacheT::getMaxCached(Size);
+ MemMapT &RegionMemMap = Region->MemMapInfo.MemMap;
+ if (UNLIKELY(!RegionMemMap.isAllocated())) {
+ DCHECK_EQ(Region->RegionBeg, 0U);
+ ReservedMemoryT ReservedMemory;
+ ReservedMemory.create(/*Addr=*/0U, RegionSize, "scudo:primary_reserve");
----------------
cferris1000 wrote:
Does this only reserve the memory for this region?
Can it be modified to allow failure and return a nullptr? The person trying to use this sees a failure here, but it could mean that the allowed VA space has been exhausted.
https://github.com/llvm/llvm-project/pull/74531
More information about the llvm-commits
mailing list