35 class AllocationManager::MallocAllocator :
public Allocator {
37 void* Allocate(
size_t size)
override {
return malloc(size); }
38 void Deallocate(
void* p)
override { free(p); }
49 AllocationManager::AllocationManager()
51 malloc_allocator_(new MallocAllocator) {
55 default_allocators_[
kLongTerm] = malloc_allocator_;
kShortTerm is used for objects that are very transient in nature, such as scratch memory used to comp...
#define ION_DECLARE_SAFE_STATIC_POINTER(type, variable)
Declare a static non-array pointer and calls a default constructor.
AllocationManager is a singleton class that is used to manage Allocators used to allocate Ion objects...
kLongTerm is used for objects that have persistent lifetimes, such as managers.
kMediumTerm is used for objects that don't fall into the kShortTerm or kLongTerm categories.