Removal of OverrideShim, AP seems to be crashing

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-12-09 17:13:09 -08:00
parent b96be71c61
commit 947adc0248
62 changed files with 299 additions and 1222 deletions
+3 -25
View File
@@ -23,19 +23,9 @@ inline void* CryModuleMallocImpl(size_t size, const char* file, const int line)
#define CryModuleFree(ptr) CryModuleFreeImpl(ptr, __FILE__, __LINE__)
#define CryModuleMemalignFree(ptr) CryModuleFreeImpl(ptr, __FILE__, __LINE__)
inline void CryModuleFreeImpl(void* ptr, const char* file, const int line)
inline void CryModuleFreeImpl(void* ptr, const char*, const int)
{
AZ::IAllocator& allocator = AZ::AllocatorInstance<AZ::LegacyAllocator>::GetAllocator();
if (allocator.IsAllocationSourceChanged())
{
allocator.GetAllocationSource()->DeAllocate(ptr);
}
else
{
static_cast<AZ::LegacyAllocator&>(allocator).DeAllocate(ptr, file, line);
}
AZ::AllocatorInstance<AZ::LegacyAllocator>::Get().DeAllocate(ptr, 0, 0);
}
#define CryModuleMemalign(size, alignment) CryModuleMemalignImpl(size, alignment, __FILE__, __LINE__)
@@ -79,17 +69,5 @@ inline void* CryModuleReallocAlignImpl(void* prev, size_t size, size_t alignment
}
#endif
AZ::IAllocator& allocator = AZ::AllocatorInstance<AZ::LegacyAllocator>::GetAllocator();
void *ptr;
if (allocator.IsAllocationSourceChanged())
{
ptr = allocator.GetAllocationSource()->ReAllocate(prev, size, 0);
}
else
{
ptr = static_cast<AZ::LegacyAllocator&>(allocator).ReAllocate(prev, size, 0, file, line);
}
return ptr;
return AZ::AllocatorInstance<AZ::LegacyAllocator>::Get().ReAllocate(prev, size, 0);
}