TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::TrackingAllocator Class Reference

Allocation hooks that count what is live, for finding leaks. More...

#include <gui_core/memory/gui_tracking_allocator.h>

Public Member Functions

 TrackingAllocator ()
 ~TrackingAllocator ()
 TrackingAllocator (const TrackingAllocator &)=delete
TrackingAllocator & operator= (const TrackingAllocator &)=delete
AllocationHooks Hooks ()
 Hooks that allocate through this allocator; valid while it lives.
size_t LiveAllocations () const
 Allocations not freed yet.
size_t LiveBytes () const
 Their total size in bytes, as requested.
size_t TotalAllocations () const
 Ever made, including freed ones.
size_t ReportLeaks () const
 Logs a warning per live allocation; returns how many there are.

Detailed Description

Allocation hooks that count what is live, for finding leaks.

Logs a warning for every allocation still live when it is destroyed. Thread-safe.

Constructor & Destructor Documentation

◆ TrackingAllocator() [1/2]

tachyon::TrackingAllocator::TrackingAllocator ( )

◆ ~TrackingAllocator()

tachyon::TrackingAllocator::~TrackingAllocator ( )

◆ TrackingAllocator() [2/2]

tachyon::TrackingAllocator::TrackingAllocator ( const TrackingAllocator & )
delete

Member Function Documentation

◆ operator=()

TrackingAllocator & tachyon::TrackingAllocator::operator= ( const TrackingAllocator & )
delete

◆ Hooks()

AllocationHooks tachyon::TrackingAllocator::Hooks ( )

Hooks that allocate through this allocator; valid while it lives.

◆ LiveAllocations()

size_t tachyon::TrackingAllocator::LiveAllocations ( ) const

Allocations not freed yet.

◆ LiveBytes()

size_t tachyon::TrackingAllocator::LiveBytes ( ) const

Their total size in bytes, as requested.

◆ TotalAllocations()

size_t tachyon::TrackingAllocator::TotalAllocations ( ) const

Ever made, including freed ones.

◆ ReportLeaks()

size_t tachyon::TrackingAllocator::ReportLeaks ( ) const

Logs a warning per live allocation; returns how many there are.


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