18 #ifndef ION_BASE_ALLOCATIONTRACKER_H_
19 #define ION_BASE_ALLOCATIONTRACKER_H_
28 class AllocationSizeTracker;
40 size_t requested_size,
const void* memory) = 0;
46 const void* memory) = 0;
76 #endif // ION_BASE_ALLOCATIONTRACKER_H_
AllocationTracker is an abstract base class for objects that track memory.
virtual size_t GetAllocatedBytesCount()=0
Returns the total number of memory ever allocated or deallocated, in bytes.
SharedPtr< AllocationSizeTracker > AllocationSizeTrackerPtr
Convenience typedef for shared pointer to a AllocationSizeTracker.
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...
Shareable is an abstract base class for any object that can be shared via the SharedPtr class...
SharedPtr< AllocationTracker > AllocationTrackerPtr
Convenience typedef for shared pointer to an AllocationTracker.
virtual void TrackDeallocation(const Allocator &allocator, const void *memory)=0
TrackDeallocation() is called immediately before an Allocator deallocates memory. ...
Allocator is an abstract base class for a memory allocator used for Ion objects derived from Allocata...
virtual size_t GetActiveAllocationBytesCount()=0
virtual void SetGpuTracker(const AllocationSizeTrackerPtr &gpu_tracker)=0
Sets/returns an AllocationSizeTracker instance used to track GPU memory allocations.
virtual void TrackAllocation(const Allocator &allocator, size_t requested_size, const void *memory)=0
TrackAllocation() is called immediately after an Allocator allocates memory.
virtual size_t GetDeallocationCount()=0
virtual AllocationSizeTrackerPtr GetGpuTracker()=0
virtual size_t GetAllocationCount()=0
Returns the total number of tracked allocations or deallocations.
A SharedPtr is a smart shared pointer to an instance of some class that implements reference counting...