ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
Debug

Files

file  atomic.c
 Debug formatting and state tracking for atomic operations.
 
file  atomic.h
 Debug tracking for atomic operations.
 
file  memory.h
 🔍 Memory debugging helpers for tracking allocations in debug builds
 

Functions

void debug_memory_ensure_init (void)
 Init the lifecycle of the debug memory module.
 

Detailed Description

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.

Features

Usage

Typically used via macros that inject __FILE__ and __LINE__:

#define TRACKED_MALLOC(size) debug_malloc(size, __FILE__, __LINE__)
#define TRACKED_FREE(ptr) debug_free(ptr, __FILE__, __LINE__)

At program exit, call debug_memory_report() to print memory statistics and any outstanding (leaked) allocations.

Build Modes

See also
debug_memory_report() for generating leak reports

Function Documentation

◆ debug_memory_ensure_init()

void debug_memory_ensure_init ( void  )

#include <memory.h>

Init the lifecycle of the debug memory module.

Definition at line 1427 of file debug/memory.c.

1427 {
1428 // No-op in release builds
1429}

Referenced by asciichat_shared_init().