summaryrefslogtreecommitdiff
path: root/Runtime/Allocator/LowLevelDefaultAllocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Allocator/LowLevelDefaultAllocator.cpp')
-rw-r--r--Runtime/Allocator/LowLevelDefaultAllocator.cpp33
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