Skip to content

Commit

Permalink
Fixed bug with not freeing large LinearAllocator pages
Browse files Browse the repository at this point in the history
  • Loading branch information
stanard committed Jun 16, 2022
1 parent fe83c01 commit 210b4fa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions MiniEngine/Core/LinearAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ LinearAllocationPage* LinearAllocatorPageManager::CreateNewPage( size_t PageSize

void LinearAllocator::CleanupUsedPages( uint64_t FenceID )
{
if (m_CurPage == nullptr)
return;

m_RetiredPages.push_back(m_CurPage);
m_CurPage = nullptr;
m_CurOffset = 0;
if (m_CurPage != nullptr)
{
m_RetiredPages.push_back(m_CurPage);
m_CurPage = nullptr;
m_CurOffset = 0;
}

sm_PageManager[m_AllocationType].DiscardPages(FenceID, m_RetiredPages);
m_RetiredPages.clear();
Expand Down

0 comments on commit 210b4fa

Please sign in to comment.