|
unilink
0.4.3
A simple C++ library for unified async communication
|
Memory allocation tracker for debugging and monitoring. More...
#include <memory_tracker.hpp>
Classes | |
| struct | AllocationInfo |
| struct | MemoryStats |
Public Member Functions | |
| void | track_allocation (void *ptr, size_t size, const char *file, int line, const char *function) |
| void | track_deallocation (void *ptr) |
| MemoryStats | get_stats () const |
| std::vector< AllocationInfo > | get_current_allocations () const |
| std::vector< AllocationInfo > | get_leaked_allocations () const |
| void | enable_tracking (bool enable=true) |
| void | disable_tracking () |
| bool | is_tracking_enabled () const |
| void | clear_tracking_data () |
| void | print_memory_report () const |
| void | print_leak_report () const |
| void | log_memory_report () const |
| void | log_leak_report () const |
Static Public Member Functions | |
| static MemoryTracker & | instance () |
Memory allocation tracker for debugging and monitoring.
Tracks memory allocations and deallocations to detect leaks, monitor usage patterns, and provide debugging information.
Definition at line 38 of file memory_tracker.hpp.
| void unilink::memory::MemoryTracker::clear_tracking_data | ( | ) |
Definition at line 110 of file memory_tracker.cc.
| void unilink::memory::MemoryTracker::disable_tracking | ( | ) |
Definition at line 106 of file memory_tracker.cc.
| void unilink::memory::MemoryTracker::enable_tracking | ( | bool | enable = true | ) |
Definition at line 104 of file memory_tracker.cc.
| std::vector< MemoryTracker::AllocationInfo > unilink::memory::MemoryTracker::get_current_allocations | ( | ) | const |
Definition at line 87 of file memory_tracker.cc.
| std::vector< MemoryTracker::AllocationInfo > unilink::memory::MemoryTracker::get_leaked_allocations | ( | ) | const |
Definition at line 100 of file memory_tracker.cc.
| MemoryTracker::MemoryStats unilink::memory::MemoryTracker::get_stats | ( | ) | const |
Definition at line 85 of file memory_tracker.cc.
|
static |
Definition at line 28 of file memory_tracker.cc.
| bool unilink::memory::MemoryTracker::is_tracking_enabled | ( | ) | const |
Definition at line 108 of file memory_tracker.cc.
| void unilink::memory::MemoryTracker::log_leak_report | ( | ) | const |
Definition at line 199 of file memory_tracker.cc.
| void unilink::memory::MemoryTracker::log_memory_report | ( | ) | const |
Definition at line 170 of file memory_tracker.cc.
| void unilink::memory::MemoryTracker::print_leak_report | ( | ) | const |
Definition at line 149 of file memory_tracker.cc.
| void unilink::memory::MemoryTracker::print_memory_report | ( | ) | const |
Definition at line 125 of file memory_tracker.cc.
| void unilink::memory::MemoryTracker::track_allocation | ( | void * | ptr, |
| size_t | size, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | function | ||
| ) |
Definition at line 33 of file memory_tracker.cc.
| void unilink::memory::MemoryTracker::track_deallocation | ( | void * | ptr | ) |
Definition at line 65 of file memory_tracker.cc.