size_t unusedRemainder = (size_t)((BYTE*)m_pPtrToEndOfCommittedRegion - m_pAllocPtr);
+ PTR_BYTE pCommitBaseAddress = m_pPtrToEndOfCommittedRegion;
if (IsInterleaved())
{
// The end of committed region for interleaved heaps points to the end of the executable
// page and the data pages goes right after that. So we skip the data page here.
- m_pPtrToEndOfCommittedRegion += GetOsPageSize();
+ pCommitBaseAddress += GetOsPageSize();
}
else
{
dwSizeToCommitPart /= 2;
}
- if (!CommitPages(m_pPtrToEndOfCommittedRegion, dwSizeToCommitPart))
+ if (!CommitPages(pCommitBaseAddress, dwSizeToCommitPart))
{
return FALSE;
}
// For interleaved heaps, further allocations will start from the newly committed page as they cannot
// cross page boundary.
- m_pAllocPtr = (BYTE*)m_pPtrToEndOfCommittedRegion;
+ m_pAllocPtr = (BYTE*)pCommitBaseAddress;
}
- m_pPtrToEndOfCommittedRegion += dwSizeToCommitPart;
+ m_pPtrToEndOfCommittedRegion += dwSizeToCommit;
m_dwTotalAlloc += dwSizeToCommit;
return TRUE;