35 tracker->TrackAllocation(*
this, size, ptr);
41 tracker->TrackDeallocation(*
this, p);
AllocationTracker is an abstract base class for objects that track memory.
~Allocator() override
The destructor is protected because all instances should be managed through SharedPtr.
AllocationLifetime
All memory allocated within Ion uses an Allocator chosen based on the predicted lifetime of the targe...
virtual const AllocatorPtr & GetAllocatorForLifetime(AllocationLifetime lifetime) const
Returns the correct Allocator to use to allocate memory with a specific lifetime. ...
virtual void Deallocate(void *p)=0
Derived classes must define this to return memory previously allocated by a call to Allocate()...
T * Get() const
Returns a raw pointer to the instance, which may be NULL.
void DeallocateMemory(void *p)
Deallocates a previously-allocated memory block.
void * AllocateMemory(size_t size)
Allocates memory of the given size.
virtual void * Allocate(size_t size)=0
Derived classes must define this to allocate size bytes of memory and return a pointer to it...
static const AllocatorPtr & GetDefaultAllocatorForLifetime(AllocationLifetime lifetime)