In primary32, the unused region will have max/min region index with 0
value and it's an invalid index. Skip releaseToOSMaybe in both primary32
and primary64 even it's M_PURGE_ALL.
Differential Revision: https://reviews.llvm.org/D150243
Sci->AllocatedUser -
(Sci->Stats.PoppedBlocks - Sci->Stats.PushedBlocks) * BlockSize;
+ if (UNLIKELY(BytesInFreeList == 0))
+ return 0;
+
bool MaySkip = false;
if (BytesInFreeList <= Sci->ReleaseInfo.BytesInFreeListAtLastCheckpoint) {
Region->AllocatedUser -
(Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks) * BlockSize;
+ if (UNLIKELY(BytesInFreeList == 0))
+ return 0;
+
bool MaySkip = false;
// Always update `BytesInFreeListAtLastCheckpoint` with the smallest value