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 › debug › Dwarf › SelfUnwinder › CacheEntry Public Struct CacheEntry Doc Source Public Struct std.debug.Dwarf.SelfUnwinder.CacheEntry
pub const CacheEntry = struct Fields pc : usize cie : *const Dwarf .Unwind .CommonInformationEntry cfa_rule : Dwarf .Unwind .VirtualMachine .CfaRule num_rules : u8 rules_regs : [max_rules ]u16 rules : [max_rules ]Dwarf .Unwind .VirtualMachine .RegisterRule Values Functions File debug/Dwarf/SelfUnwinder.zig: 17
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 pub const CacheEntry = struct {
const max_rules = 32 ;
pc : usize ,
cie : *const Dwarf .Unwind .CommonInformationEntry ,
cfa_rule : Dwarf .Unwind .VirtualMachine .CfaRule ,
num_rules : u8 ,
rules_regs : [max_rules ]u16 ,
rules : [max_rules ]Dwarf .Unwind .VirtualMachine .RegisterRule ,
pub fn find (entries : []const CacheEntry , pc : usize ) ?*const CacheEntry {
assert (pc != 0 );
const idx = std .hash .int (pc ) % entries .len ;
const entry = &entries [idx ];
return if (entry .pc == pc ) entry else null ;
}
pub fn populate (entry : *const CacheEntry , entries : []CacheEntry ) void {
const idx = std .hash .int (entry .pc ) % entries .len ;
entries [idx ] = entry .*;
}
pub const empty : CacheEntry = .{
.pc = 0 ,
.cie = undefined ,
.cfa_rule = undefined ,
.num_rules = undefined ,
.rules_regs = undefined ,
.rules = undefined ,
};
}