DebugAllocatorReportLeaks
Description
Append a human-readable leak report to out. For each entry in live, appends one summary line plus the captured alloc stack trace (formatted via FormatStackTrace when backtraces are enabled, otherwise raw instruction pointers).
Parameters
| Name | Direction | Description |
|---|---|---|
self |
in | DebugAllocator instance, or NULL. |
out |
in,out | Str the report is appended to; pre-existing contents are preserved. |
Success
Function returns. When live is non-empty, out has the report appended; when live is empty, out is left unchanged.
Failure
No action when self or out is NULL.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Debug.c:529:
}
void DebugAllocatorReportLeaks(DebugAllocator *self, Str *out) {
if (!self || !out)
return;- In
AllocDebug.c:125:
HeapAllocator scratch = HeapAllocatorInit();
Str out = StrInit(&scratch);
DebugAllocatorReportLeaks(&dbg, &out);
bool ok = StrLen(&out) > 0; HeapAllocator scratch = HeapAllocatorInit();
Str out = StrInit(&scratch);
DebugAllocatorReportLeaks(&dbg, &out);
bool ok = (ZstrFindSubstring(StrBegin(&out), "leak:") != NULL); HeapAllocator scratch = HeapAllocatorInit();
Str out = StrInit(&scratch);
DebugAllocatorReportLeaks(&dbg, &out);
ok = ok && (ZstrFindSubstring(StrBegin(&out), "leak:") != NULL); HeapAllocator scratch = HeapAllocatorInit();
Str out = StrInit(&scratch);
DebugAllocatorReportLeaks(&dbg, &out);
// Build the out-of-range marker "#N " that only the `<=` mutant emits.
Last updated on