|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
Files | |
| file | memory.h |
| 🔍 Memory debugging helpers for tracking allocations in debug builds | |
This module provides memory allocation wrappers that track all heap allocations for debugging and leak detection. When DEBUG_MEMORY is defined and NDEBUG is not set, all allocations are recorded in a linked list with source location metadata.
Typically used via macros that inject __FILE__ and __LINE__:
At program exit, call debug_memory_report() to print memory statistics and any outstanding (leaked) allocations.
DEBUG_MEMORY + debug build): Full allocation tracking with linked list, atomic statistics, and mutex protectionDEBUG_MEMORY + NDEBUG): Functions become thin wrappers around standard allocators with no tracking overheadDEBUG_MEMORY): Header provides no declarations