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 › compiler/ › resinator/ › cvtres.zig › Relocations
Relocations
cvtres.Relocations
const Relocations = struct
File
Code
const Relocations = struct {
allocator : Allocator ,
list : std .ArrayList (Relocation ) = .empty ,
cur_symbol_index : u32 = 5 ,
pub fn init (allocator : Allocator ) Relocations {
return .{ .allocator = allocator };
}
pub fn deinit (self : *Relocations ) void {
self .list .deinit (self .allocator );
}
pub fn add (self : *Relocations , relocation_address : u32 , data_offset : u32 ) !void {
try self .list .append (self .allocator , .{
.symbol_index = self .cur_symbol_index ,
.data_offset = data_offset ,
.relocation_address = relocation_address ,
});
self .cur_symbol_index += 1 ;
}
}