| 101 | } |
| 102 | |
| 103 | void print_stats(const char* label) { |
| 104 | printf("\n=== %s ===\n", label); |
| 105 | printf(" Peak memory: %zu bytes\n", peak_bytes.load()); |
| 106 | printf(" Current memory: %zu bytes\n", current_bytes.load()); |
| 107 | printf(" Total allocated: %zu bytes\n", total_allocated.load()); |
| 108 | printf(" Allocations: %d\n", alloc_count.load()); |
| 109 | printf(" Frees: %d\n", free_count.load()); |
| 110 | printf(" Active allocs: %zu\n", count_active_allocations()); |
| 111 | printf(" Leaked bytes: %zu\n", current_bytes.load()); |
| 112 | } |
| 113 | }; |
| 114 | |
| 115 | AllocationStats g_stats; |
no test coverage detected