Skip to content

Commit

Permalink
Fix whitespace and other formatting things
Browse files Browse the repository at this point in the history
  • Loading branch information
JaxLinAMD authored Sep 29, 2021
1 parent 12c9330 commit 9921f14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
11 changes: 5 additions & 6 deletions src/core/internalMemMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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();
Expand Down
7 changes: 3 additions & 4 deletions src/core/internalMemMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ struct GpuMemoryPool
uint64 pagingFenceVal; // Paging fence value

Util::BuddyAllocator<Platform>* 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
};

// =====================================================================================================================
Expand Down Expand Up @@ -120,15 +120,14 @@ class InternalMemMgr

Result Map(
GpuMemory* pGpuMemory,
void** ppData);
void** ppData);

Result Unmap(
GpuMemory* pGpuMemory);

// 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,
Expand Down

0 comments on commit 9921f14

Please sign in to comment.