From 9921f149acefe2f3307a18ccc92ba2c2adf44955 Mon Sep 17 00:00:00 2001 From: JaxLinAMD <39079076+JaxLinAMD@users.noreply.github.com> Date: Wed, 29 Sep 2021 17:00:15 +0800 Subject: [PATCH] Fix whitespace and other formatting things --- src/core/internalMemMgr.cpp | 11 +++++------ src/core/internalMemMgr.h | 7 +++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/core/internalMemMgr.cpp b/src/core/internalMemMgr.cpp index 0919eab6..219cbfd9 100644 --- a/src/core/internalMemMgr.cpp +++ b/src/core/internalMemMgr.cpp @@ -139,7 +139,6 @@ InternalMemMgr::InternalMemMgr( // Explicitly frees all GPU memory allocations. void InternalMemMgr::FreeAllocations() { - for (auto it = m_poolList.Begin(); it.Get() != nullptr; it.Next()) { PAL_ASSERT((it.Get() != nullptr) && (it.Get()->pBuddyAllocator != nullptr)); @@ -585,8 +584,8 @@ uint32 InternalMemMgr::GetReferencesCount() // ===================================================================================================================== // Map the GPU memory allocation for cpu access Result InternalMemMgr::Map( - GpuMemory* pGpuMemory, - void** ppData) + GpuMemory* pGpuMemory, + void** ppData) { PAL_ASSERT(pGpuMemory != nullptr); Result result = Result::ErrorInvalidValue; @@ -646,7 +645,7 @@ Result InternalMemMgr::Map( // ===================================================================================================================== // Unmap the GPU memory allocation from cpu address space Result InternalMemMgr::Unmap( - GpuMemory* pGpuMemory) + GpuMemory* pGpuMemory) { PAL_ASSERT(pGpuMemory != nullptr); if (pGpuMemory->WasBuddyAllocated()) @@ -687,8 +686,8 @@ void InternalMemMgr::CheckMappedPoolLimit() { if (m_pDevice->Settings().maxMappedPoolsSize >= 0) { - while ((m_totalSizeMappedPools > m_pDevice->Settings().maxMappedPoolsSize) - && (m_unusedMappedPoolList.NumElements() > 0)) + while ((m_totalSizeMappedPools > m_pDevice->Settings().maxMappedPoolsSize) && + (m_unusedMappedPoolList.NumElements() > 0)) { auto it = m_unusedMappedPoolList.Begin(); GpuMemoryPool *pPool = *it.Get(); diff --git a/src/core/internalMemMgr.h b/src/core/internalMemMgr.h index aa27be1e..bd4287c3 100644 --- a/src/core/internalMemMgr.h +++ b/src/core/internalMemMgr.h @@ -56,8 +56,8 @@ struct GpuMemoryPool uint64 pagingFenceVal; // Paging fence value Util::BuddyAllocator* pBuddyAllocator; // Buddy allocator used for the suballocation - void* pData; // address of the already existing mapping - size_t refCount; // refCount the number of memory allocations use this mapping + void* pData; // Address of the already existing mapping + size_t refCount; // Tracks the number of memory allocations use this mapping }; // ===================================================================================================================== @@ -120,7 +120,7 @@ class InternalMemMgr Result Map( GpuMemory* pGpuMemory, - void** ppData); + void** ppData); Result Unmap( GpuMemory* pGpuMemory); @@ -128,7 +128,6 @@ class InternalMemMgr // If the number of mapped pools are more then the maximum limit then unmap the least recently used pool. void CheckMappedPoolLimit(); - private: Result AllocateBaseGpuMem( const GpuMemoryCreateInfo& createInfo,