2015-08-17 05:26:58 +00:00
|
|
|
#include "CGameAllocator.hpp"
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2015-08-17 22:05:00 +00:00
|
|
|
{
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
logvisor::Module AllocLog("CGameAllocator");
|
2015-10-28 04:45:02 +00:00
|
|
|
|
2015-08-23 23:58:07 +00:00
|
|
|
CGameAllocator::SGameMemInfo* CGameAllocator::FindFreeBlock(u32)
|
|
|
|
{
|
2015-08-31 03:44:42 +00:00
|
|
|
return nullptr;
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
|
|
|
CGameAllocator::SGameMemInfo* CGameAllocator::FindFreeBlockFromTopOfHeap(u32)
|
|
|
|
{
|
2015-08-31 03:44:42 +00:00
|
|
|
return nullptr;
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
|
|
|
u32 CGameAllocator::FixupAllocPtrs(SGameMemInfo*, u32, u32, EHint, const CCallStack&)
|
|
|
|
{
|
2015-08-31 03:44:42 +00:00
|
|
|
return 0;
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
|
|
|
void CGameAllocator::UpdateAllocDebugStats(u32, u32, u32)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
bool CGameAllocator::FreeNormalAllocation(void*)
|
2015-08-17 05:26:58 +00:00
|
|
|
{
|
2015-08-31 03:44:42 +00:00
|
|
|
return false;
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
|
|
|
u32 CGameAllocator::GetFreeBinEntryForSize(u32)
|
|
|
|
{
|
2015-08-31 03:44:42 +00:00
|
|
|
return 0;
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
|
|
|
void CGameAllocator::AddFreeEntryToFreeList(SGameMemInfo*)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void CGameAllocator::RemoveFreeEntryFromFreeList(SGameMemInfo*)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void CGameAllocator::DumpAllocations() const
|
|
|
|
{
|
|
|
|
}
|
|
|
|
u32 CGameAllocator::GetLargestFreeChunk() const
|
|
|
|
{
|
2015-08-31 03:44:42 +00:00
|
|
|
return 0;
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
|
|
|
CGameAllocator::SGameMemInfo* CGameAllocator::GetMemInfoFromBlockPtr(void* ptr)
|
|
|
|
{
|
|
|
|
return reinterpret_cast<SGameMemInfo*>(reinterpret_cast<u8*>(ptr) - 32);
|
2015-08-17 05:26:58 +00:00
|
|
|
}
|
|
|
|
|
2015-08-28 00:11:31 +00:00
|
|
|
bool CGameAllocator::Initialize()
|
2015-08-23 23:58:07 +00:00
|
|
|
{
|
2015-08-31 03:44:42 +00:00
|
|
|
return false;
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
2015-08-17 05:26:58 +00:00
|
|
|
void CGameAllocator::Shutdown()
|
|
|
|
{
|
|
|
|
}
|
2015-10-28 04:45:02 +00:00
|
|
|
void* CGameAllocator::Alloc(size_t sz, EHint, EScope, EType, const CCallStack&)
|
2015-08-23 23:58:07 +00:00
|
|
|
{
|
2016-03-04 23:04:53 +00:00
|
|
|
//AllocLog.report(logvisor::Warning, _S("Remind Phil to reimplement Alloc!!!!"));
|
2015-10-28 04:45:02 +00:00
|
|
|
return malloc(sz);
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
2015-10-28 04:45:02 +00:00
|
|
|
void CGameAllocator::Free(void* ptr)
|
2015-08-23 23:58:07 +00:00
|
|
|
{
|
2015-10-28 04:45:02 +00:00
|
|
|
free(ptr);
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
|
|
|
void CGameAllocator::ReleaseAll()
|
|
|
|
{
|
|
|
|
}
|
2015-10-28 04:45:02 +00:00
|
|
|
void* CGameAllocator::AllocSecondary(size_t sz, EHint, EScope, EType, const CCallStack&)
|
2015-08-23 23:58:07 +00:00
|
|
|
{
|
2015-10-28 04:45:02 +00:00
|
|
|
return malloc(sz);
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
|
|
|
void CGameAllocator::FreeSecondary(void*)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void CGameAllocator::ReleaseAllSecondary()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void CGameAllocator::SetOutOfMemoryCallback(const TOutOfMemoryCallback cb, void* ctx)
|
|
|
|
{
|
|
|
|
x58_oomCb = cb;
|
|
|
|
x5c_oomCtx = ctx;
|
|
|
|
}
|
|
|
|
int CGameAllocator::EnumAllocations(const TAllocationVisitCallback, void*, bool) const
|
|
|
|
{
|
2015-08-31 03:44:42 +00:00
|
|
|
return 0;
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
|
|
|
CGameAllocator::SAllocInfo CGameAllocator::GetAllocInfo(void*) const
|
|
|
|
{
|
2015-08-31 03:44:42 +00:00
|
|
|
return CGameAllocator::SAllocInfo();
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
|
|
|
void CGameAllocator::OffsetFakeStatics(int)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
CGameAllocator::SMetrics CGameAllocator::GetMetrics() const
|
|
|
|
{
|
2015-08-31 03:44:42 +00:00
|
|
|
return CGameAllocator::SMetrics();
|
2015-08-23 23:58:07 +00:00
|
|
|
}
|
2015-08-17 22:05:00 +00:00
|
|
|
|
|
|
|
}
|