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 library itself.
Zig › std/ › zig/ › llvm/ › Builder.zig › trailingStrtabStringAssumeCapacity
trailingStrtabStringAssumeCapacity
Builder.trailingStrtabStringAssumeCapacity
pub fn trailingStrtabStringAssumeCapacity (self : *Builder ) StrtabString
File
Code
pub fn trailingStrtabStringAssumeCapacity (self : *Builder ) StrtabString {
const start = self .strtab_string_indices .getLast ().?;
const bytes : []const u8 = self .strtab_string_bytes .items [start ..];
const gop = self .strtab_string_map .getOrPutAssumeCapacityAdapted (bytes , StrtabString .Adapter { .builder = self });
if (gop .found_existing ) {
self .strtab_string_bytes .shrinkRetainingCapacity (start );
} else {
self .strtab_string_indices .appendAssumeCapacity (@intCast (self .strtab_string_bytes .items .len ));
}
return StrtabString .fromIndex (gop .index );
}