5 #ifndef EASTL_CORE_ALLOCATOR_H
6 #define EASTL_CORE_ALLOCATOR_H
8 #if EASTL_CORE_ALLOCATOR_ENABLED
10 #include <coreallocator/icoreallocator.h>
29 class EASTLCoreAllocatorImpl :
public ICoreAllocator
32 virtual void* Alloc(
size_t size,
const char* name,
unsigned int flags)
34 return ::operator
new[](size, name, flags, 0, __FILE__, __LINE__);
37 virtual void* Alloc(
size_t size,
const char* name,
unsigned int flags,
unsigned int alignment,
unsigned int alignOffset = 0)
39 return ::operator
new[](size, alignment, alignOffset, name, flags, 0, __FILE__, __LINE__);
42 virtual void Free(
void* ptr,
size_t size = 0)
44 ::operator
delete(
static_cast<char*
>(ptr));
47 virtual void* AllocDebug(
size_t size,
const DebugParams debugParams,
unsigned int flags)
49 return Alloc(size, debugParams.mName, flags);
52 virtual void* AllocDebug(
size_t size,
const DebugParams debugParams,
unsigned int flags,
unsigned int align,
unsigned int alignOffset = 0)
54 return Alloc(size, debugParams.mName, flags, align, alignOffset);
60 inline EASTLCoreAllocatorImpl* EASTLCoreAllocatorImpl::GetDefaultAllocator()
62 static EASTLCoreAllocatorImpl allocator;
EASTL_API allocator * GetDefaultAllocator()
Definition: allocator_eastl.cpp:30