18 #ifndef ION_BASE_ALLOCATOR_H_
19 #define ION_BASE_ALLOCATOR_H_
21 #include "base/macros.h"
48 static const int kNumAllocationLifetimes =
kLongTerm + 1;
64 void* AllocateMemory(
size_t size);
67 void DeallocateMemory(
void* p);
95 virtual void* Allocate(
size_t size) = 0;
99 virtual void Deallocate(
void* p) = 0;
110 #endif // ION_BASE_ALLOCATOR_H_
kShortTerm is used for objects that are very transient in nature, such as scratch memory used to comp...
const AllocationTrackerPtr & GetTracker() const
AllocationLifetime
All memory allocated within Ion uses an Allocator chosen based on the predicted lifetime of the targe...
SharedPtr< Allocator > AllocatorPtr
void SetTracker(const AllocationTrackerPtr &tracker)
Sets/returns an AllocationTracker instance used to track the workings of this instance.
Shareable is an abstract base class for any object that can be shared via the SharedPtr class...
Allocator is an abstract base class for a memory allocator used for Ion objects derived from Allocata...
Copyright 2016 Google Inc.
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.