testing/core

sourcetesting/core.sx

LeakRecord

pub type LeakRecord = { address: ref void, size: i64, line: i64, file: ref u8 }

One live allocation reported by -leak-check.

Fields

NameType
addressref void
sizei64
linei64
fileref u8

LeakDiagnostics

pub type LeakDiagnostics = { enabled: i64, live_allocations: i64, live_bytes: i64, total_allocations: i64, total_frees: i64, peak_live_bytes: i64, invalid_frees: i64, records: ref LeakRecord, record_count: i64 }

Fields

NameType
enabledi64
live_allocationsi64
live_bytesi64
total_allocationsi64
total_freesi64
peak_live_bytesi64
invalid_freesi64
recordsref LeakRecord
record_counti64

leak_record_at

private
fn leak_record_at(records: ref LeakRecord, index: i64) ref LeakRecord

pprint

pub fn (LeakDiagnostics) pprint(ld: LeakDiagnostics) void

Print a readable leak summary to stdout.

pprint_str

pub fn (LeakDiagnostics) pprint_str(ld: LeakDiagnostics) str.String

Return the same summary as a heap-allocated String.