-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathallocator_eastl.cpp
56 lines (32 loc) · 1.43 KB
/
allocator_eastl.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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