|
Ion
|
FullAllocationTracker is a derived AllocationTracker class that keeps track of all active allocations and also provides tracing facilities for debugging and error checking of leaked allocations. More...
#include "fullallocationtracker.h"
Public Member Functions | |
| FullAllocationTracker () | |
| FullAllocationTracker functions. More... | |
| void | SetTracingStream (std::ostream *s) |
| Sets an output stream to use for tracing allocations and deallocations. More... | |
| std::ostream * | GetTracingStream () const |
| void | TrackAllocation (const Allocator &allocator, size_t requested_size, const void *memory) override |
| AllocationTracker interface implementations. More... | |
| void | TrackDeallocation (const Allocator &allocator, const void *memory) override |
| TrackDeallocation() is called immediately before an Allocator deallocates memory. More... | |
| size_t | GetAllocationCount () override |
| Returns the total number of tracked allocations or deallocations. More... | |
| size_t | GetDeallocationCount () override |
| size_t | GetAllocatedBytesCount () override |
| Returns the total number of memory ever allocated or deallocated, in bytes. More... | |
| size_t | GetDeallocatedBytesCount () override |
| size_t | GetActiveAllocationCount () override |
| Returns the number of active allocations or the amount of memory in bytes used by active allocations. More... | |
| size_t | GetActiveAllocationBytesCount () override |
| void | SetGpuTracker (const AllocationSizeTrackerPtr &gpu_tracker) override |
| Sets/returns an AllocationSizeTracker instance used to track GPU memory allocations. More... | |
| AllocationSizeTrackerPtr | GetGpuTracker () override |
| int | GetRefCount () const |
| GetRefCount() is part of the interface necessary for SharedPtr. More... | |
Protected Member Functions | |
| ~FullAllocationTracker () override | |
| The destructor is protected because all instances should be managed through SharedPtr. More... | |
FullAllocationTracker is a derived AllocationTracker class that keeps track of all active allocations and also provides tracing facilities for debugging and error checking of leaked allocations.
Definition at line 32 of file fullallocationtracker.h.
| ion::base::FullAllocationTracker::FullAllocationTracker | ( | ) |
FullAllocationTracker functions.
Definition at line 207 of file fullallocationtracker.cc.
|
overrideprotected |
The destructor is protected because all instances should be managed through SharedPtr.
This logs an error for each allocation that is still active.
Definition at line 211 of file fullallocationtracker.cc.
|
overridevirtual |
Implements ion::base::AllocationTracker.
Definition at line 262 of file fullallocationtracker.cc.
|
overridevirtual |
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.
Implements ion::base::AllocationTracker.
Definition at line 258 of file fullallocationtracker.cc.
|
overridevirtual |
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.
Implements ion::base::AllocationTracker.
Definition at line 250 of file fullallocationtracker.cc.
|
overridevirtual |
Returns the total number of tracked allocations or deallocations.
Implements ion::base::AllocationTracker.
Definition at line 242 of file fullallocationtracker.cc.
|
overridevirtual |
Implements ion::base::AllocationTracker.
Definition at line 254 of file fullallocationtracker.cc.
|
overridevirtual |
Implements ion::base::AllocationTracker.
Definition at line 246 of file fullallocationtracker.cc.
|
overridevirtual |
Implements ion::base::AllocationTracker.
Definition at line 268 of file fullallocationtracker.cc.
|
inlineinherited |
GetRefCount() is part of the interface necessary for SharedPtr.
Definition at line 34 of file shareable.h.
Referenced by ion::base::Notifier::RemoveReceiver().
|
inline |
Definition at line 41 of file fullallocationtracker.h.
|
overridevirtual |
Sets/returns an AllocationSizeTracker instance used to track GPU memory allocations.
Implements ion::base::AllocationTracker.
Definition at line 266 of file fullallocationtracker.cc.
|
inline |
Sets an output stream to use for tracing allocations and deallocations.
If the stream is non-NULL, tracing is enabled, and a message is printed to the stream for each allocation or deallocation. The default is a NULL stream.
Definition at line 40 of file fullallocationtracker.h.
|
overridevirtual |
AllocationTracker interface implementations.
Implements ion::base::AllocationTracker.
Definition at line 216 of file fullallocationtracker.cc.
|
overridevirtual |
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.
Implements ion::base::AllocationTracker.
Definition at line 226 of file fullallocationtracker.cc.
References ion::port::ERROR, ion::base::kInvalidIndex, and LOG.