Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › heap › debug_allocator › DebugAllocator › bucketStackTrace Private Function bucketStackTrace Doc Source Private Function std.heap.debug_allocator.DebugAllocator.bucketStackTrace
fn bucketStackTrace (
bucket : *BucketHeader ,
slot_count : usize ,
slot_index : SlotIndex ,
trace_kind : TraceKind ,
) StackTrace Params File heap/debug_allocator.zig: 330
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345 fn bucketStackTrace (
bucket : *BucketHeader ,
slot_count : usize ,
slot_index : SlotIndex ,
trace_kind : TraceKind ,
) StackTrace {
const stack_addresses = bucket .stackTracePtr (slot_count , slot_index , trace_kind );
var len : usize = 0 ;
while (len < stack_n and stack_addresses [len ] != 0 ) {
len += 1 ;
}
return .{
.return_addresses = stack_addresses [0 ..len ],
.skipped = if (len < stack_addresses .len ) .none else .unknown ,
};
}