Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::base::AllocationTracker Class Referenceabstract

AllocationTracker is an abstract base class for objects that track memory. More...

#include "allocationtracker.h"

Inheritance diagram for ion::base::AllocationTracker:
Collaboration diagram for ion::base::AllocationTracker:

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...
 

Detailed Description

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.

Member Function Documentation

virtual size_t ion::base::AllocationTracker::GetActiveAllocationBytesCount ( )
pure virtual
virtual size_t ion::base::AllocationTracker::GetActiveAllocationCount ( )
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.

virtual size_t ion::base::AllocationTracker::GetAllocatedBytesCount ( )
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.

virtual size_t ion::base::AllocationTracker::GetAllocationCount ( )
pure virtual

Returns the total number of tracked allocations or deallocations.

Implemented in ion::base::FullAllocationTracker.

virtual size_t ion::base::AllocationTracker::GetDeallocatedBytesCount ( )
pure virtual
virtual size_t ion::base::AllocationTracker::GetDeallocationCount ( )
pure virtual
virtual AllocationSizeTrackerPtr ion::base::AllocationTracker::GetGpuTracker ( )
pure virtual
int ion::base::Shareable::GetRefCount ( ) const
inlineinherited

GetRefCount() is part of the interface necessary for SharedPtr.

Definition at line 34 of file shareable.h.

Referenced by ion::base::Notifier::RemoveReceiver().

virtual void ion::base::AllocationTracker::SetGpuTracker ( const AllocationSizeTrackerPtr gpu_tracker)
pure virtual

Sets/returns an AllocationSizeTracker instance used to track GPU memory allocations.

Implemented in ion::base::FullAllocationTracker.

virtual void ion::base::AllocationTracker::TrackAllocation ( const Allocator allocator,
size_t  requested_size,
const void *  memory 
)
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.

virtual void ion::base::AllocationTracker::TrackDeallocation ( const Allocator allocator,
const void *  memory 
)
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.


The documentation for this class was generated from the following file: