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.

deinit

Must be the same allocator passed to parse or findNative.

LibCInstallation.deinit
pub fn deinit(self: *LibCInstallation, allocator: Allocator) void

File

lib/std/zig/LibCInstallation.zig:238

Code

pub fn deinit(self: *LibCInstallation, allocator: Allocator) void {
    inline for (@typeInfo(LibCInstallation).@"struct".field_names) |field_name| {
        if (@field(self, field_name)) |payload| {
            allocator.free(payload);
        }
    }
    self.* = undefined;
}