diff --git a/compiler-rt/lib/scudo/standalone/primary64.h b/compiler-rt/lib/scudo/standalone/primary64.h index 209dfc90c65b7..7eaaae37c61c2 100644 --- a/compiler-rt/lib/scudo/standalone/primary64.h +++ b/compiler-rt/lib/scudo/standalone/primary64.h @@ -756,14 +756,8 @@ template class SizeClassAllocator64 { } // TODO: Consider allocating MemMap in init(). if (!Region->MemMap.isAllocated()) { - // TODO: Ideally, a region should reserve RegionSize because the memory - // between `RegionBeg` and region base is still belong to a region and - // it's just not used. In order to make it work on every platform (some - // of them don't support `remap()` across the unused range), dispatch - // from `RegionBeg` for now. - const uptr ReserveSize = - RegionSize - (RegionBeg - getRegionBaseByClassId(ClassId)); - Region->MemMap = ReservedMemory.dispatch(RegionBeg, ReserveSize); + Region->MemMap = ReservedMemory.dispatch( + getRegionBaseByClassId(ClassId), RegionSize); } DCHECK(Region->MemMap.isAllocated());