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

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

#include "allocationsizetracker.h"

Inheritance diagram for ion::base::AllocationSizeTracker:
Collaboration diagram for ion::base::AllocationSizeTracker:

Public Member Functions

virtual void TrackAllocationSize (size_t allocation_size)=0
 TrackAllocationSize() increments the currently tracked allocation size and the number of allocations. More...
 
virtual void TrackDeallocationSize (size_t deallocation_size)=0
 TrackDeallocationSize() decrements the current tracked allocation size and increments the number of deallocations. More...
 
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

AllocationSizeTracker is an abstract base class for objects that track memory.

Definition at line 30 of file allocationsizetracker.h.

Member Function Documentation

virtual size_t ion::base::AllocationTracker::GetActiveAllocationBytesCount ( )
pure virtualinherited
virtual size_t ion::base::AllocationTracker::GetActiveAllocationCount ( )
pure virtualinherited

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 virtualinherited

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 virtualinherited

Returns the total number of tracked allocations or deallocations.

Implemented in ion::base::FullAllocationTracker.

virtual size_t ion::base::AllocationTracker::GetDeallocatedBytesCount ( )
pure virtualinherited
virtual size_t ion::base::AllocationTracker::GetDeallocationCount ( )
pure virtualinherited
virtual AllocationSizeTrackerPtr ion::base::AllocationTracker::GetGpuTracker ( )
pure virtualinherited
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 virtualinherited

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 virtualinherited

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::AllocationSizeTracker::TrackAllocationSize ( size_t  allocation_size)
pure virtual

TrackAllocationSize() increments the currently tracked allocation size and the number of allocations.

virtual void ion::base::AllocationTracker::TrackDeallocation ( const Allocator allocator,
const void *  memory 
)
pure virtualinherited

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.

virtual void ion::base::AllocationSizeTracker::TrackDeallocationSize ( size_t  deallocation_size)
pure virtual

TrackDeallocationSize() decrements the current tracked allocation size and increments the number of deallocations.


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