Ion
|
AllocationTracker is an abstract base class for objects that track memory. More...
#include "allocationtracker.h"
Public Member Functions | |
virtual void | TrackAllocation (const Allocator &allocator, size_t requested_size, const void *memory)=0 |
TrackAllocation() is called immediately after an Allocator allocates memory. More... | |
virtual void | TrackDeallocation (const Allocator &allocator, const void *memory)=0 |
TrackDeallocation() is called immediately before an Allocator deallocates memory. More... | |
virtual size_t | GetAllocationCount ()=0 |
Returns the total number of tracked allocations or deallocations. More... | |
virtual size_t | GetDeallocationCount ()=0 |
virtual size_t | GetAllocatedBytesCount ()=0 |
Returns the total number of memory ever allocated or deallocated, in bytes. More... | |
virtual size_t | GetDeallocatedBytesCount ()=0 |
virtual size_t | GetActiveAllocationCount ()=0 |
Returns the number of active allocations or the amount of memory in bytes used by active allocations. More... | |
virtual size_t | GetActiveAllocationBytesCount ()=0 |
virtual void | SetGpuTracker (const AllocationSizeTrackerPtr &gpu_tracker)=0 |
Sets/returns an AllocationSizeTracker instance used to track GPU memory allocations. More... | |
virtual AllocationSizeTrackerPtr | GetGpuTracker ()=0 |
int | GetRefCount () const |
GetRefCount() is part of the interface necessary for SharedPtr. More... | |
AllocationTracker is an abstract base class for objects that track memory.
An Allocator instance may contain a pointer to an AllocationTracker that is invoked whenever a chunk of memory is allocated or deallocated.
Definition at line 34 of file allocationtracker.h.
|
pure virtual |
Implemented in ion::base::FullAllocationTracker.
|
pure virtual |
Returns the number of active allocations or the amount of memory in bytes used by active allocations.
These are not guaranteed to be supported by all derived classes; they may return 0 if not.
Implemented in ion::base::FullAllocationTracker.
|
pure virtual |
Returns the total number of memory ever allocated or deallocated, in bytes.
These are not guaranteed to be supported by all derived classes; they may return 0 if not.
Implemented in ion::base::FullAllocationTracker.
|
pure virtual |
Returns the total number of tracked allocations or deallocations.
Implemented in ion::base::FullAllocationTracker.
|
pure virtual |
Implemented in ion::base::FullAllocationTracker.
|
pure virtual |
Implemented in ion::base::FullAllocationTracker.
|
pure virtual |
Implemented in ion::base::FullAllocationTracker.
|
inlineinherited |
GetRefCount() is part of the interface necessary for SharedPtr.
Definition at line 34 of file shareable.h.
Referenced by ion::base::Notifier::RemoveReceiver().
|
pure virtual |
Sets/returns an AllocationSizeTracker instance used to track GPU memory allocations.
Implemented in ion::base::FullAllocationTracker.
|
pure virtual |
TrackAllocation() is called immediately after an Allocator allocates memory.
It receives a reference to the Allocator that allocated the memory, the requested size, and a pointer to the allocated memory.
Implemented in ion::base::FullAllocationTracker.
|
pure virtual |
TrackDeallocation() is called immediately before an Allocator deallocates memory.
It receives a reference to the Allocator that is deallocating the memory and a pointer to the deallocated memory.
Implemented in ion::base::FullAllocationTracker.