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 › zig › llvm › BitcodeReader › Abbrev › Store Private Struct Store Doc Source Private Struct std.zig.llvm.BitcodeReader.Abbrev.Store
const Store = struct Fields Functions File zig/llvm/BitcodeReader.zig: 490
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518 const Store = struct {
abbrevs : std .ArrayList (Abbrev ),
fn deinit (store : *Store , allocator : std .mem .Allocator ) void {
for (store .abbrevs .items ) |abbrev | allocator .free (abbrev .operands );
store .abbrevs .deinit (allocator );
store .* = undefined ;
}
fn addAbbrev (store : *Store , allocator : std .mem .Allocator , abbrev : Abbrev ) !void {
try store .ensureUnusedCapacity (allocator , 1 );
store .addAbbrevAssumeCapacity (abbrev );
}
fn addAbbrevAssumeCapacity (store : *Store , allocator : std .mem .Allocator , abbrev : Abbrev ) !void {
store .abbrevs .appendAssumeCapacity (.{
.operands = try allocator .dupe (Abbrev .Operand , abbrev .operands ),
});
}
fn addOwnedAbbrev (store : *Store , allocator : std .mem .Allocator , abbrev : Abbrev ) !void {
try store .abbrevs .ensureUnusedCapacity (allocator , 1 );
store .addOwnedAbbrevAssumeCapacity (abbrev );
}
fn addOwnedAbbrevAssumeCapacity (store : *Store , abbrev : Abbrev ) void {
store .abbrevs .appendAssumeCapacity (abbrev );
}
}