diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Allocator/LowLevelDefaultAllocator.cpp |
Diffstat (limited to 'Runtime/Allocator/LowLevelDefaultAllocator.cpp')
-rw-r--r-- | Runtime/Allocator/LowLevelDefaultAllocator.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Runtime/Allocator/LowLevelDefaultAllocator.cpp b/Runtime/Allocator/LowLevelDefaultAllocator.cpp new file mode 100644 index 0000000..010406c --- /dev/null +++ b/Runtime/Allocator/LowLevelDefaultAllocator.cpp @@ -0,0 +1,33 @@ +#include "UnityPrefix.h" +#include "LowLevelDefaultAllocator.h" +#include "Runtime/Allocator/MemoryManager.h" + +#if ENABLE_MEMORY_MANAGER + + +void* LowLevelAllocator::Malloc (size_t size) { return MemoryManager::LowLevelAllocate(size); } +void* LowLevelAllocator::Realloc (void* ptr, size_t size) { return MemoryManager::LowLevelReallocate(ptr, size); } +void LowLevelAllocator::Free (void* ptr) { MemoryManager::LowLevelFree(ptr); } + + +#if UNITY_XENON +#include "PlatformDependent/Xbox360/Source/XenonMemory.h" + +#if XBOX_USE_DEBUG_MEMORY +// Uses debug memory on compatible devkits +void* LowLevelAllocatorDebugMem::Malloc(size_t size) +{ + return DmDebugAlloc(size); +} +void* LowLevelAllocatorDebugMem::Realloc (void* ptr, size_t size) +{ + ErrorString("LowLevelAllocatorDebugMem::Realloc is not implemented."); + return 0; +} +void LowLevelAllocatorDebugMem::Free (void* ptr) +{ + DmDebugFree(ptr); +} +#endif // XBOX_USE_DEBUG_MEMORY +#endif +#endif |