mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 16:15:43 +00:00
Add free function to memory manager
This commit is contained in:
parent
ca9ee04738
commit
338de302d9
@ -47,6 +47,19 @@ char* MemoryManager::Dup(const char* str)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MemoryManager::Free(void* data)
|
||||||
|
{
|
||||||
|
for (auto iAlloc = m_allocations.begin(); iAlloc != m_allocations.end(); ++iAlloc)
|
||||||
|
{
|
||||||
|
if (*iAlloc == data)
|
||||||
|
{
|
||||||
|
free(*iAlloc);
|
||||||
|
m_allocations.erase(iAlloc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MemoryManager::Delete(void* data)
|
void MemoryManager::Delete(void* data)
|
||||||
{
|
{
|
||||||
for (auto iAlloc = m_destructible.begin(); iAlloc != m_destructible.end(); ++iAlloc)
|
for (auto iAlloc = m_destructible.begin(); iAlloc != m_destructible.end(); ++iAlloc)
|
||||||
|
@ -57,5 +57,6 @@ public:
|
|||||||
return &allocation->m_entry;
|
return &allocation->m_entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Free(void* data);
|
||||||
void Delete(void* data);
|
void Delete(void* data);
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user