structstd.net.AddressList[src]

Fields

arena: std.heap.ArenaAllocator
addrs: []Address
canon_name: ?[]u8

Functions

Functiondeinit[src]

pub fn deinit(self: *AddressList) void

Parameters

Source Code

Source code
pub fn deinit(self: *AddressList) void {
    // Here we copy the arena allocator into stack memory, because
    // otherwise it would destroy itself while it was still working.
    var arena = self.arena;
    arena.deinit();
    // self is destroyed
}

Source Code

Source code
pub const AddressList = struct {
    arena: std.heap.ArenaAllocator,
    addrs: []Address,
    canon_name: ?[]u8,

    pub fn deinit(self: *AddressList) void {
        // Here we copy the arena allocator into stack memory, because
        // otherwise it would destroy itself while it was still working.
        var arena = self.arena;
        arena.deinit();
        // self is destroyed
    }
}