From e59cf7b09e7388d369e8d2bf73501cde79c28708 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Thu, 8 Apr 2021 16:43:58 +0200 Subject: Squashed 'EASTL/' content from commit fad5471 git-subtree-dir: EASTL git-subtree-split: fad54717f8e4ebb13b20095da7efd07a53af0f10 --- source/allocator_eastl.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 source/allocator_eastl.cpp (limited to 'source/allocator_eastl.cpp') diff --git a/source/allocator_eastl.cpp b/source/allocator_eastl.cpp new file mode 100644 index 0000000..6b48168 --- /dev/null +++ b/source/allocator_eastl.cpp @@ -0,0 +1,56 @@ +///////////////////////////////////////////////////////////////////////////// +// Copyright (c) Electronic Arts Inc. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#include +#include + + +/////////////////////////////////////////////////////////////////////////////// +// 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 + + + + + + + + + + + -- cgit v1.2.3