A class for checkpoint tracking of memory allocations allocated by the HeapAllocator. More...
Public Types | |
typedef std::map< void *, AllocTrackingInfo, std::less< void * > > | TrackingMap |
Public Member Functions | |
void | allocate (void *address) |
Called when memory is allocated for a tracked object. | |
void | deallocate (void *address) |
Called when memory is deallocated for a tracked object. | |
void | setObjAddress (void *address) |
bool | hasAllocation (void *ptr) const |
Returns true iff the specified address lies within a tracked memory allocation. | |
void | getAllocationsSince (AllocTrackingInfo::Checkpoint checkpoint, AllocTrackingInfo::Vector &allocations) const |
Static Public Member Functions | |
static AllocTrackingInfo::Checkpoint | IncCheckpointIndex () |
A class for checkpoint tracking of memory allocations allocated by the HeapAllocator.
void DD::Image::AllocationTracker::setObjAddress | ( | void * | address | ) |
Called from constructors of tracked objects with their this pointer. This allows us to track the actual object address within an allocated block.
AllocTrackingInfo::Checkpoint DD::Image::AllocationTracker::IncCheckpointIndex | ( | ) | [static] |
Increments the checkpoint index, and returns the new index . This allows test code to determine what was allocated since a particular moment of execution
void DD::Image::AllocationTracker::getAllocationsSince | ( | AllocTrackingInfo::Checkpoint | checkpoint, |
AllocTrackingInfo::Vector & | allocations | ||
) | const |
Clears and populates a container of objects describing memory allocations tracked by this tracker, allocated at or since the specified checkpoint