aboutsummaryrefslogtreecommitdiff
path: root/EASTL/source/allocator_eastl.cpp
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-04-08 16:43:58 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-04-08 16:43:58 +0200
commita3c405074db4c53e9da042a8772135fb9bf6caa2 (patch)
tree3417be8827d1eed95a415e7ee68dbc4263085405 /EASTL/source/allocator_eastl.cpp
parentac1b72946c226eb3cd4f3f0b8f13a8330142ebe8 (diff)
parente59cf7b09e7388d369e8d2bf73501cde79c28708 (diff)
Merge commit 'e59cf7b09e7388d369e8d2bf73501cde79c28708' as 'EASTL'
Diffstat (limited to 'EASTL/source/allocator_eastl.cpp')
-rw-r--r--EASTL/source/allocator_eastl.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/EASTL/source/allocator_eastl.cpp b/EASTL/source/allocator_eastl.cpp
new file mode 100644
index 0000000..6b48168
--- /dev/null
+++ b/EASTL/source/allocator_eastl.cpp
@@ -0,0 +1,56 @@
+/////////////////////////////////////////////////////////////////////////////
+// Copyright (c) Electronic Arts Inc. All rights reserved.
+/////////////////////////////////////////////////////////////////////////////
+
+
+#include <EASTL/internal/config.h>
+#include <EASTL/allocator.h>
+
+
+///////////////////////////////////////////////////////////////////////////////
+// ReadMe
+//
+// This file implements the default application allocator.
+// You can replace this allocator.cpp file with a different one,
+// you can define EASTL_USER_DEFINED_ALLOCATOR below to ignore this file,
+// or you can modify the EASTL config.h file to redefine how allocators work.
+///////////////////////////////////////////////////////////////////////////////
+
+
+#ifndef EASTL_USER_DEFINED_ALLOCATOR // If the user hasn't declared that he has defined an allocator implementation elsewhere...
+
+ namespace eastl
+ {
+
+ /// gDefaultAllocator
+ /// Default global allocator instance.
+ EASTL_API allocator gDefaultAllocator;
+ EASTL_API allocator* gpDefaultAllocator = &gDefaultAllocator;
+
+ EASTL_API allocator* GetDefaultAllocator()
+ {
+ return gpDefaultAllocator;
+ }
+
+ EASTL_API allocator* SetDefaultAllocator(allocator* pAllocator)
+ {
+ allocator* const pPrevAllocator = gpDefaultAllocator;
+ gpDefaultAllocator = pAllocator;
+ return pPrevAllocator;
+ }
+
+ } // namespace eastl
+
+
+#endif // EASTL_USER_DEFINED_ALLOCATOR
+
+
+
+
+
+
+
+
+
+
+