Skip to documentation
SLOP

tiny.tldr.incremental

Reference tiny.tldr incremental

Defined in tiny.tldr.

API (136)

Actions

Public operations.

Types and contracts

Public types and contracts.

Values and defaults

Public values and defaults.

No direct callersNo direct callstiny.tldrincremental
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/tldr/src/incremental/format.zig:443

zig
pub const ManifestFieldPatch = struct {    offset: usize,    len: usize,    bytes: [manifest_field_patch_capacity]u8,    pub fn slice(self: *const ManifestFieldPatch) []const u8 {        return self.bytes[0..self.len];    }};

Source: lib/tldr/src/incremental/manifest.zig:192

zig
pub const ArchiveMemberRecord = extern struct {    hash: u64 align(1),    link_hash: u64 align(1) = 0,    input_index: u64 align(1),    name_id: u32 align(1),    selected: bool,};

Source: lib/tldr/src/incremental/manifest.zig:2287

zig
pub const Builder = struct {    allocator: Allocator,    target: model.Target,    output_kind: model.OutputKind,    entry_symbol_id: u32,    image_base: u64,    page_size: u64,    gc_sections: bool,    icf: model.IcfMode,    strip_debug: bool,    build_id: model.BuildIdMode,    input_hashes_recorded: bool,    contribution_records_enabled: bool,    inputs_read_at_ns: i64,    strings: Strings = .{},    inputs: std.ArrayListUnmanaged(InputRecord) = .empty,    sections: std.ArrayListUnmanaged(SectionRecord) = .empty,    contributions: std.ArrayListUnmanaged(ContributionRecord) = .empty,    discarded_contributions: std.ArrayListUnmanaged(DiscardedContributionRecord) = .empty,    external_targets: std.ArrayListUnmanaged(ExternalTargetRecord) = .empty,    archive_members: std.ArrayListUnmanaged(ArchiveMemberRecord) = .empty,    got_entries: std.ArrayListUnmanaged(GotEntryRecord) = .empty,    merge_pieces: std.ArrayListUnmanaged(MergePieceRecord) = .empty,    pub fn init(allocator: Allocator, options: model.LinkOptions) Allocator.Error!Builder {        const incremental_records_enabled = options.incremental_mode != .off;        var builder = Builder{            .allocator = allocator,            .target = options.target,            .output_kind = options.output_kind,            .entry_symbol_id = 0,            .image_base = options.image_base,            .page_size = options.page_size,            .gc_sections = options.gc_sections,            .icf = options.icf,            .strip_debug = options.strip_debug,            .build_id = options.build_id,            .input_hashes_recorded = incremental_records_enabled,            .contribution_records_enabled = incremental_records_enabled,            .inputs_read_at_ns = options.inputs_read_at_ns,        };        errdefer builder.deinit();        builder.entry_symbol_id = try builder.strings.intern(allocator, options.entry_symbol);        return builder;    }    pub fn recordsContributions(self: Builder) bool {        return self.contribution_records_enabled;    }    pub fn deinit(self: *Builder) void {        self.strings.deinit(self.allocator);        self.inputs.deinit(self.allocator);        self.sections.deinit(self.allocator);        self.contributions.deinit(self.allocator);        self.discarded_contributions.deinit(self.allocator);        self.external_targets.deinit(self.allocator);        self.archive_members.deinit(self.allocator);        self.got_entries.deinit(self.allocator);        self.merge_pieces.deinit(self.allocator);        self.* = undefined;    }    pub fn addInput(self: *Builder, input: model.Input) Allocator.Error!void {        const hash = if (self.input_hashes_recorded) hashBytes(input.bytes) else 0;        const identity = input.identity orelse model.InputIdentity{ .mtime_ns = 0, .inode = 0 };        try self.inputs.append(self.allocator, .{            .name_id = try self.strings.intern(self.allocator, input.name),            .size = input.bytes.len,            .hash = hash,            .mtime_ns = identity.mtime_ns,            .inode = identity.inode,            .identity_recorded = input.identity != null,            .link_hash = hash,        });    }    pub fn setInputLinkHash(self: *Builder, input_index: usize, link_hash: u64) void {        if (!self.input_hashes_recorded) return;        if (input_index >= self.inputs.items.len) return;        self.inputs.items[input_index].link_hash = link_hash;    }    pub fn setInputSelectionHash(self: *Builder, input_index: usize, selection_hash: u64) void {        if (!self.input_hashes_recorded) return;        if (input_index >= self.inputs.items.len) return;        self.inputs.items[input_index].selection_hash = selection_hash;    }    pub fn addArchiveMember(        self: *Builder,        input_index: usize,        name: []const u8,        hash: u64,        link_hash: u64,        selected: bool,    ) Allocator.Error!void {        if (!self.contribution_records_enabled) return;        try self.archive_members.append(self.allocator, .{            .input_index = input_index,            .name_id = try self.strings.intern(self.allocator, name),            .hash = hash,            .link_hash = link_hash,            .selected = selected,        });    }    pub fn addSection(        self: *Builder,        name: []const u8,        address: u64,        file_offset: u64,        size: u64,        reserved_size: u64,        alignment: u64,    ) Allocator.Error!void {        try self.sections.append(self.allocator, .{            .name_id = try self.strings.intern(self.allocator, name),            .address = address,            .file_offset = file_offset,            .size = size,            .reserved_size = reserved_size,            .alignment = alignment,        });    }    pub fn addContribution(        self: *Builder,        input_name: []const u8,        input_index: usize,        kind: ContributionKind,        name: []const u8,        ordinal: u32,        output_section_name: []const u8,        address: u64,        file_offset: u64,        size: u64,        reserved_size: u64,        alignment: u64,    ) Allocator.Error!void {        return try self.addContributionWithFileSize(            input_name,            input_index,            kind,            name,            ordinal,            output_section_name,            address,            file_offset,            size,            size,            reserved_size,            alignment,        );    }    pub fn addContributionWithFileSize(        self: *Builder,        input_name: []const u8,        input_index: usize,        kind: ContributionKind,        name: []const u8,        ordinal: u32,        output_section_name: []const u8,        address: u64,        file_offset: u64,        size: u64,        file_size: u64,        reserved_size: u64,        alignment: u64,    ) Allocator.Error!void {        if (!self.contribution_records_enabled) return;        try self.contributions.append(self.allocator, .{            .input_name_id = try self.strings.intern(self.allocator, input_name),            .input_index = input_index,            .kind = kind,            .name_id = try self.strings.intern(self.allocator, name),            .ordinal = ordinal,            .output_section_name_id = try self.strings.intern(self.allocator, output_section_name),            .address = address,            .file_offset = file_offset,            .size = size,            .file_size = file_size,            .reserved_size = reserved_size,            .alignment = alignment,        });    }    pub fn addDiscardedContribution(        self: *Builder,        input_name: []const u8,        input_index: usize,        name: []const u8,        ordinal: u32,        reason: DiscardReason,        size: u64,        alignment: u64,    ) Allocator.Error!void {        if (!self.contribution_records_enabled) return;        try self.discarded_contributions.append(self.allocator, .{            .input_name_id = try self.strings.intern(self.allocator, input_name),            .input_index = input_index,            .name_id = try self.strings.intern(self.allocator, name),            .ordinal = ordinal,            .reason = reason,            .size = size,            .alignment = alignment,        });    }    pub fn addExternalTarget(        self: *Builder,        name: []const u8,        resolved_address: i128,        size: u64,    ) Allocator.Error!void {        if (!self.contribution_records_enabled) return;        const name_id = try self.strings.intern(self.allocator, name);        const record = ExternalTargetRecord.fromResolved(name_id, resolved_address, size) orelse return;        try self.external_targets.append(self.allocator, record);    }    pub fn addGotEntry(        self: *Builder,        input_index: usize,        input_name: []const u8,        ordinal: u32,        name: []const u8,        address: u64,    ) Allocator.Error!void {        if (!self.contribution_records_enabled) return;        try self.got_entries.append(self.allocator, .{            .input_index = input_index,            .input_name_id = try self.strings.intern(self.allocator, input_name),            .ordinal = ordinal,            .name_id = try self.strings.intern(self.allocator, name),            .address = address,        });    }    pub fn addMergePiece(        self: *Builder,        input_index: usize,        input_name: []const u8,        ordinal: u32,        input_offset: u64,        size: u64,        address: u64,    ) Allocator.Error!void {        if (!self.contribution_records_enabled) return;        try self.merge_pieces.append(self.allocator, .{            .input_index = input_index,            .input_name_id = try self.strings.intern(self.allocator, input_name),            .ordinal = ordinal,            .input_offset = input_offset,            .size = size,            .address = address,        });    }    pub fn finish(self: *Builder) Allocator.Error!Manifest {        var strings = self.strings;        self.strings = .{};        errdefer strings.deinit(self.allocator);        strings.ids.deinit(self.allocator);        strings.ids = .empty;        return .{            .target = self.target,            .output_kind = self.output_kind,            .entry_symbol_id = self.entry_symbol_id,            .image_base = self.image_base,            .page_size = self.page_size,            .gc_sections = self.gc_sections,            .icf = self.icf,            .strip_debug = self.strip_debug,            .build_id = self.build_id,            .input_hashes_recorded = self.input_hashes_recorded,            .inputs_read_at_ns = self.inputs_read_at_ns,            .strings = strings,            .inputs = try self.inputs.toOwnedSlice(self.allocator),            .sections = try self.sections.toOwnedSlice(self.allocator),            .contributions = try self.contributions.toOwnedSlice(self.allocator),            .discarded_contributions = try self.discarded_contributions.toOwnedSlice(self.allocator),            .external_targets = try self.external_targets.toOwnedSlice(self.allocator),            .archive_members = try self.archive_members.toOwnedSlice(self.allocator),            .got_entries = try self.got_entries.toOwnedSlice(self.allocator),            .merge_pieces = try self.merge_pieces.toOwnedSlice(self.allocator),            .owned = .{                .inputs = true,                .sections = true,                .contributions = true,                .discarded_contributions = true,                .external_targets = true,                .archive_members = true,                .got_entries = true,                .merge_pieces = true,            },        };    }};

Source: lib/tldr/src/incremental/manifest.zig:128

zig
pub const ContributionKind = enum(u8) {    section,    common_symbol,};

Source: lib/tldr/src/incremental/manifest.zig:133

zig
pub const ContributionRecord = extern struct {    address: u64 align(1),    file_offset: u64 align(1),    size: u64 align(1),    file_size: u64 align(1),    reserved_size: u64 align(1),    alignment: u64 align(1),    input_index: u64 align(1),    input_name_id: u32 align(1),    name_id: u32 align(1),    output_section_name_id: u32 align(1),    ordinal: u32 align(1),    kind: ContributionKind,};

Source: lib/tldr/src/incremental/manifest.zig:148

zig
pub const DiscardReason = enum(u8) {    discarded,    identical_code_folded,};

Source: lib/tldr/src/incremental/manifest.zig:153

zig
pub const DiscardedContributionRecord = extern struct {    size: u64 align(1),    alignment: u64 align(1),    input_index: u64 align(1),    input_name_id: u32 align(1),    name_id: u32 align(1),    ordinal: u32 align(1),    reason: DiscardReason,};

Source: lib/tldr/src/incremental/manifest.zig:163

zig
pub const ExternalTargetRecord = extern struct {    address_bits: u64 align(1),    size: u64 align(1),    name_id: u32 align(1),    address_signed: bool = false,    pub fn fromResolved(name_id: u32, resolved_address: i128, size: u64) ?ExternalTargetRecord {        if (resolved_address < 0) {            const signed = std.math.cast(i64, resolved_address) orelse return null;            return .{                .name_id = name_id,                .address_bits = @bitCast(signed),                .address_signed = true,                .size = size,            };        }        return .{            .name_id = name_id,            .address_bits = std.math.cast(u64, resolved_address) orelse return null,            .size = size,        };    }    pub fn address(self: ExternalTargetRecord) i128 {        if (self.address_signed) return @as(i64, @bitCast(self.address_bits));        return self.address_bits;    }};

Source: lib/tldr/src/incremental/manifest.zig:200

zig
pub const GotEntryRecord = extern struct {    address: u64 align(1),    input_index: u64 align(1),    input_name_id: u32 align(1),    name_id: u32 align(1),    ordinal: u32 align(1),};

Source: lib/tldr/src/incremental/manifest.zig:224

zig
pub const InputChange = struct {    kind: InputChangeKind,    recorded_index: ?usize = null,    current_index: ?usize = null,};

Source: lib/tldr/src/incremental/manifest.zig:217

zig
pub const InputChangeKind = enum {    unchanged,    changed,    added,    removed,};

Source: lib/tldr/src/incremental/manifest.zig:401

zig
pub const InputChangeStorage = struct {    phase: alloc_phase.capacity.Phase,    capacity: Capacity,    limits: Limits,    storage: Storage,    changes: []InputChange,    matched_current: []bool,    current_links: []u32,    current_by_name: []InputChangeNameEntry,    pub const storage_alignment: usize = @max(        @alignOf(InputChange),        @alignOf(InputChangeNameEntry),    );    pub const Storage = []align(storage_alignment) u8;    pub const Limits: type = InputChangeLimits;    pub const Capacity: type = InputChangeCapacity;    pub const Exhaustion = error{InputCountExceedsCapacity};    pub const InitError = Capacity.DeriveError || error{StorageTooShort};    pub const work_limits: alloc_phase.capacity.WorkLimits = .{        .transition_steps_max = std.math.maxInt(usize),        .cleanup_steps_per_call_max = 0,        .cleanup_calls_at_capacity_max = 0,    };    pub const claim: alloc_phase.capacity.Declaration = .{        .source = .{            .id = "tldr.input_change_storage",            .kind = .phase_static,            .limit_source = .caller,            .storage = .{                .covered = &.{                    .{                        .id = "classification_scratch_and_retained_name_index",                        .lifetime = .steady,                        .detail = "classification scratch and retained name index",                    },                },                .excluded = &.{                    "borrowed manifest records, strings, and current input bytes",                    "downstream replacement, candidate-image, and output storage",                },            },            .capacity = .{                .inputs = &.{                    alloc_phase.capacity.bindInput(Limits, "current_inputs", "current_inputs"),                    alloc_phase.capacity.bindInput(Limits, "recorded_inputs", "recorded_inputs"),                },                .type_selectors = &.{                    alloc_phase.capacity.bindType(InputChange, "change"),                    alloc_phase.capacity.bindType(u32, "u32"),                    alloc_phase.capacity.bindType(InputChangeNameEntry, "nameslot"),                },                .nodes = &.{                    .{ .input = 0 },                    .{ .scale = .{ .node = 0, .coefficient = .{ .literal = 2 } } },                    .{ .next_power_of_two = 1 },                    .{ .input = 1 },                    .{ .scale = .{ .node = 3, .coefficient = .{ .size_of_concrete_type = 0 } } },                    .{ .alignment = .{ .node = 4, .alignment = .{ .literal = 16 } } },                    .{ .alignment = .{ .node = 3, .alignment = .{ .literal = 16 } } },                    .{ .scale = .{ .node = 0, .coefficient = .{ .size_of_concrete_type = 1 } } },                    .{ .alignment = .{ .node = 7, .alignment = .{ .literal = 16 } } },                    .{ .scale = .{ .node = 2, .coefficient = .{ .size_of_concrete_type = 2 } } },                    .{ .alignment = .{ .node = 9, .alignment = .{ .literal = 16 } } },                    .{ .add = .{ .left = 5, .right = 6 } },                    .{ .add = .{ .left = 11, .right = 8 } },                    .{ .add = .{ .left = 12, .right = 10 } },                },                .assertions = &.{.{                    .scope = .closure_total,                    .measure = .retained,                    .relation = .exact,                    .expression = 13,                }},            },            .overload = .{                .kind = .reject_before_mutation,                .detail = "over-capacity input counts preserve the prior result and workspace",            },            .risks = .{                .transitive = .{                    .status = .witnessed,                    .detail = "classification calls only fixed slices, Wyhash, and allocator-free content hashing",                },                .foreign = .{                    .status = .excluded,                    .detail = "classification has no callback or operating-system boundary",                },            },            .work = .{ .equation = "linear matching scans current inputs; indexed lookup probes at most name_slots" },            .obligations = &.{                .{ .key = "tldr_input_change_capacity_capacity_model", .role = .capacity_model },                .{ .key = "tldr_input_change_capacity_overload", .role = .overload },                .{ .key = "tldr_input_change_oom_retry", .role = .custom },                .{ .key = "tldr_input_change_region", .role = .overload },                .{ .key = "tldr_input_change_sealed_transitive_risk", .role = .transitive_risk },                .{ .key = "tldr_input_change_sealed_foreign_risk", .role = .foreign_risk },                .{ .key = "tldr_input_change_max_plus_one", .role = .overload },                .{ .key = "tldr_input_change_differential", .role = .work_bound },            },        },        .bindings = .{            .owner = @This(),            .seal = .{                .family = alloc_phase.capacity.selector(@This().activate),                .premise = .{                    .class = .checked_semantic_fact,                    .authority = .checker,                },            },            .teardown = .{                .family = alloc_phase.capacity.selector(@This().deinit),                .premise = .{                    .class = .checked_semantic_fact,                    .authority = .checker,                },            },        },    };    pub fn init(storage: Storage, limits: Limits) InitError!InputChangeStorage {        const capacity = try Capacity.derive(limits);        if (storage.len < capacity.storage_bytes) return error.StorageTooShort;        const owned = storage[0..capacity.storage_bytes];        return .{            .phase = .initialization,            .capacity = capacity,            .limits = limits,            .storage = owned,            .changes = inputChangeSlice(                InputChange,                owned,                capacity.changes_offset,                capacity.change_records,            ),            .matched_current = inputChangeSlice(                bool,                owned,                capacity.matched_offset,                capacity.matched_flags,            ),            .current_links = inputChangeSlice(                u32,                owned,                capacity.links_offset,                capacity.current_links,            ),            .current_by_name = inputChangeSlice(                InputChangeNameEntry,                owned,                capacity.names_offset,                capacity.name_slots,            ),        };    }    pub fn activate(self: *InputChangeStorage) void {        std.debug.assert(self.phase == .initialization);        self.assertStorage();        self.phase = .steady;    }    /// The call matches `current_inputs` with the recorded inputs by name, in    /// order, and marks each one unchanged, changed, added or removed. A relink    /// (a later link that compares its inputs with recorded ones) calls this    /// function first to learn which inputs changed since the manifest (the    /// record a prepared link keeps beside its output) was written. An input    /// counts as unchanged when its size matches and either its file identity    /// matches or its content hash does. A file identity matches when the    /// manifest recorded one, the current input carries one, the inode and    /// modification time are equal, and that modification time is earlier than    /// the time the recorded inputs were read. The returned view stays valid    /// until the next successful classification or teardown. When either input    /// count exceeds what the storage was sized for, the call returns    /// `error.InputCountExceedsCapacity` and leaves the previous view and the    /// workspace as they were.    pub fn classify(        self: *InputChangeStorage,        recorded: RecordedInputs,        current_inputs: []const model.Input,    ) Exhaustion!InputChanges {        std.debug.assert(self.phase == .steady);        if (recorded.inputs.len > self.capacity.recorded_inputs or            current_inputs.len > self.capacity.current_inputs)        {            return error.InputCountExceedsCapacity;        }        self.assertStorage();        if (recorded.inputs.len <= linear_input_classification_limit or            current_inputs.len <= linear_input_classification_limit)        {            return self.classifyLinear(recorded, current_inputs);        }        return self.classifyIndexed(recorded, current_inputs);    }    pub fn deinit(self: *InputChangeStorage) Storage {        std.debug.assert(self.phase != .teardown);        self.assertStorage();        const storage = self.storage;        self.phase = .teardown;        self.storage = &.{};        self.changes = &.{};        self.matched_current = &.{};        self.current_links = &.{};        self.current_by_name = &.{};        return storage;    }    fn classifyLinear(        self: *InputChangeStorage,        recorded_inputs: RecordedInputs,        current_inputs: []const model.Input,    ) InputChanges {        const matched_current = self.matched_current[0..current_inputs.len];        @memset(matched_current, false);        var change_count: usize = 0;        var summary: InputChangeSummary = .{};        for (recorded_inputs.inputs, 0..) |recorded, recorded_index| {            const current_index = findUnmatchedInput(                current_inputs,                matched_current,                recorded_inputs.string(recorded.name_id),            ) orelse {                self.append(&change_count, &summary, .{                    .kind = .removed,                    .recorded_index = recorded_index,                });                continue;            };            matched_current[current_index] = true;            const current = current_inputs[current_index];            self.append(&change_count, &summary, .{                .kind = if (inputContentUnchanged(                    recorded,                    current,                    recorded_inputs.inputs_read_at_ns,                )) .unchanged else .changed,                .recorded_index = recorded_index,                .current_index = current_index,            });        }        for (matched_current, 0..) |matched, current_index| {            if (matched) continue;            self.append(&change_count, &summary, .{                .kind = .added,                .current_index = current_index,            });        }        return .{ .changes = self.changes[0..change_count], .summary = summary };    }    fn classifyIndexed(        self: *InputChangeStorage,        recorded_inputs: RecordedInputs,        current_inputs: []const model.Input,    ) InputChanges {        const matched_current = self.matched_current[0..current_inputs.len];        @memset(matched_current, false);        const current_links = self.current_links[0..current_inputs.len];        @memset(current_links, no_input_index);        @memset(self.current_by_name, .{});        var current_index = current_inputs.len;        while (current_index != 0) {            current_index -= 1;            self.pushCurrent(current_inputs, current_links, current_index);        }        var change_count: usize = 0;        var summary: InputChangeSummary = .{};        for (recorded_inputs.inputs, 0..) |recorded, recorded_index| {            const matched_index = self.popCurrent(                current_inputs,                current_links,                recorded_inputs.string(recorded.name_id),            ) orelse {                self.append(&change_count, &summary, .{                    .kind = .removed,                    .recorded_index = recorded_index,                });                continue;            };            matched_current[matched_index] = true;            const current = current_inputs[matched_index];            self.append(&change_count, &summary, .{                .kind = if (inputContentUnchanged(                    recorded,                    current,                    recorded_inputs.inputs_read_at_ns,                )) .unchanged else .changed,                .recorded_index = recorded_index,                .current_index = matched_index,            });        }        for (matched_current, 0..) |matched, unmatched_index| {            if (matched) continue;            self.append(&change_count, &summary, .{                .kind = .added,                .current_index = unmatched_index,            });        }        return .{ .changes = self.changes[0..change_count], .summary = summary };    }    fn append(        self: *InputChangeStorage,        count: *usize,        summary: *InputChangeSummary,        change: InputChange,    ) void {        std.debug.assert(count.* < self.changes.len);        self.changes[count.*] = change;        count.* += 1;        switch (change.kind) {            .unchanged => summary.unchanged += 1,            .changed => summary.changed += 1,            .added => summary.added += 1,            .removed => summary.removed += 1,        }    }    fn popCurrent(        self: *InputChangeStorage,        current_inputs: []const model.Input,        current_links: []const u32,        name: []const u8,    ) ?usize {        const entry = self.findCurrent(current_inputs, name) orelse return null;        const input_index = entry.head_index;        if (input_index == no_input_index) return null;        const current_index: usize = @intCast(input_index);        const next_index = current_links[current_index];        entry.head_index = next_index;        return current_index;    }    fn pushCurrent(        self: *InputChangeStorage,        current_inputs: []const model.Input,        current_links: []u32,        input_index: usize,    ) void {        const entry = self.findOrCreateCurrent(current_inputs, input_index);        if (entry.head_index != no_input_index) {            current_links[input_index] = entry.head_index;        }        entry.head_index = @intCast(input_index);    }    fn findOrCreateCurrent(        self: *InputChangeStorage,        current_inputs: []const model.Input,        input_index: usize,    ) *InputChangeNameEntry {        std.debug.assert(input_index < current_inputs.len);        const name = current_inputs[input_index].name;        const slots = self.current_by_name;        std.debug.assert(slots.len != 0);        const mask = slots.len - 1;        const hash: usize = @truncate(std.hash.Wyhash.hash(0, name));        var slot_index = hash & mask;        var probes: usize = 0;        while (probes < slots.len) : (probes += 1) {            const entry = &slots[slot_index];            if (entry.key_index == no_input_index) {                entry.* = .{ .key_index = @intCast(input_index) };                return entry;            }            const key_index: usize = @intCast(entry.key_index);            if (std.mem.eql(u8, current_inputs[key_index].name, name)) {                return entry;            }            slot_index = (slot_index + 1) & mask;        }        unreachable;    }    fn findCurrent(        self: *InputChangeStorage,        current_inputs: []const model.Input,        name: []const u8,    ) ?*InputChangeNameEntry {        const slots = self.current_by_name;        if (slots.len == 0) return null;        const mask = slots.len - 1;        const hash: usize = @truncate(std.hash.Wyhash.hash(0, name));        var slot_index = hash & mask;        var probes: usize = 0;        while (probes < slots.len) : (probes += 1) {            const entry = &slots[slot_index];            if (entry.key_index == no_input_index) return null;            const key_index: usize = @intCast(entry.key_index);            if (std.mem.eql(u8, current_inputs[key_index].name, name)) {                return entry;            }            slot_index = (slot_index + 1) & mask;        }        return null;    }    fn assertStorage(self: *const InputChangeStorage) void {        const expected = Capacity.derive(self.limits) catch unreachable;        std.debug.assert(std.meta.eql(expected, self.capacity));        std.debug.assert(self.storage.len == self.capacity.storage_bytes);        std.debug.assert(self.changes.len == self.capacity.change_records);        std.debug.assert(self.matched_current.len == self.capacity.matched_flags);        std.debug.assert(self.current_links.len == self.capacity.current_links);        std.debug.assert(self.current_by_name.len == self.capacity.name_slots);    }};

Source: lib/tldr/src/incremental/manifest.zig:230

zig
pub const InputChangeSummary = struct {    unchanged: usize = 0,    changed: usize = 0,    added: usize = 0,    removed: usize = 0,    pub fn allUnchanged(self: InputChangeSummary) bool {        return self.changed == 0 and self.added == 0 and self.removed == 0;    }};

Source: lib/tldr/src/incremental/manifest.zig:252

zig
pub const InputChanges = struct {    /// The slice carries one record per recorded or current input, each marked    /// unchanged, changed, added or removed: the recorded inputs come first in    /// their recorded order, and the added inputs follow in their current    /// order. The relink planner reads these records to decide whether the    /// output can be reused or patched during a relink (a later link that    /// compares its inputs with recorded ones). This slice lives in the    /// classification storage and stays valid until that storage completes    /// another classification or is torn down.    changes: []const InputChange = &.{},    summary: InputChangeSummary = .{},    pub fn allUnchanged(self: InputChanges) bool {        return self.summary.allUnchanged();    }};

Source: lib/tldr/src/incremental/manifest.zig:241

zig
pub const InputContributionSummary = struct {    retained: usize = 0,    discarded: usize = 0,    retained_size: u64 = 0,    discarded_size: u64 = 0,    pub fn isEmpty(self: InputContributionSummary) bool {        return self.retained == 0 and self.discarded == 0;    }};

Source: lib/tldr/src/incremental/manifest.zig:107

zig
pub const InputRecord = extern struct {    size: u64 align(1),    hash: u64 align(1),    mtime_ns: i64 align(1) = 0,    inode: u64 align(1) = 0,    identity_recorded: bool = false,    _pad: [3]u8 = @splat(0),    name_id: u32 align(1),    link_hash: u64 align(1),    selection_hash: u64 align(1) = 0,};

Source: lib/tldr/src/incremental/manifest.zig:911

zig
pub const Manifest = struct {    target: model.Target,    output_kind: model.OutputKind,    entry_symbol_id: u32 = 0,    image_base: u64,    page_size: u64,    gc_sections: bool,    icf: model.IcfMode,    strip_debug: bool,    build_id: model.BuildIdMode,    input_hashes_recorded: bool,    inputs_read_at_ns: i64 = 0,    strings: Strings = .{},    inputs: []InputRecord = &.{},    sections: []SectionRecord = &.{},    contributions: []ContributionRecord = &.{},    discarded_contributions: []DiscardedContributionRecord = &.{},    external_targets: []ExternalTargetRecord = &.{},    archive_members: []ArchiveMemberRecord = &.{},    got_entries: []GotEntryRecord = &.{},    merge_pieces: []MergePieceRecord = &.{},    owned: RecordOwnership = .{},    pub fn empty() Manifest {        return .{            .target = .{},            .output_kind = .executable,            .image_base = 0,            .page_size = 0,            .gc_sections = false,            .icf = .off,            .strip_debug = false,            .build_id = .none,            .input_hashes_recorded = false,        };    }    pub fn fromBinary(allocator: Allocator, bytes: []u8) !Manifest {        return try format.manifestFromBinary(allocator, bytes);    }    pub fn string(self: *const Manifest, id: u32) []const u8 {        return self.strings.get(id);    }    pub fn entrySymbol(self: *const Manifest) []const u8 {        if (self.strings.count() == 0) return "";        return self.strings.get(self.entry_symbol_id);    }    pub fn deinit(self: *Manifest, allocator: Allocator) void {        if (self.owned.inputs and self.inputs.len != 0) allocator.free(self.inputs);        if (self.owned.sections and self.sections.len != 0) allocator.free(self.sections);        if (self.owned.contributions and self.contributions.len != 0) allocator.free(self.contributions);        if (self.owned.discarded_contributions and self.discarded_contributions.len != 0) allocator.free(self.discarded_contributions);        if (self.owned.external_targets and self.external_targets.len != 0) allocator.free(self.external_targets);        if (self.owned.archive_members and self.archive_members.len != 0) allocator.free(self.archive_members);        if (self.owned.got_entries and self.got_entries.len != 0) allocator.free(self.got_entries);        if (self.owned.merge_pieces and self.merge_pieces.len != 0) allocator.free(self.merge_pieces);        self.strings.deinit(allocator);        self.* = empty();    }    pub fn take(self: *Manifest) Manifest {        const manifest = self.*;        self.* = empty();        return manifest;    }    pub fn canReuseFor(self: Manifest, options: model.LinkOptions, inputs: []const model.Input) bool {        if (!self.input_hashes_recorded) return false;        if (!self.canReuseOptions(options)) return false;        if (self.inputs.len != inputs.len) return false;        for (inputs, 0..) |input, index| {            const record = self.inputs[index];            if (!std.mem.eql(u8, self.string(record.name_id), input.name)) return false;            if (!inputContentUnchanged(record, input, self.inputs_read_at_ns)) return false;        }        return true;    }    pub fn canReuseOptions(self: Manifest, options: model.LinkOptions) bool {        if (options.incremental_mode == .off) return false;        if (self.target.object_format != options.target.object_format) return false;        if (self.target.architecture != options.target.architecture) return false;        if (self.target.endianness != options.target.endianness) return false;        if (self.target.pointer_width_bits != options.target.pointer_width_bits) return false;        if (self.output_kind != options.output_kind) return false;        if (self.image_base != options.image_base) return false;        if (self.page_size != options.page_size) return false;        if (self.gc_sections != options.gc_sections) return false;        if (self.icf != options.icf) return false;        if (self.strip_debug != options.strip_debug) return false;        if (self.build_id != options.build_id) return false;        if (!std.mem.eql(u8, self.entrySymbol(), options.entry_symbol)) return false;        return true;    }    pub fn planContributionReplacement(        self: Manifest,        replacements: []const ReplacementContribution,    ) PatchPlan {        return patch.planContributionReplacement(self, replacements);    }    pub fn applyContributionReplacement(        self: Manifest,        image: []u8,        replacements: []const ReplacementContribution,    ) PatchApplyError!PatchApplication {        return try patch.applyContributionReplacement(self, image, replacements);    }    pub fn formatTextAlloc(self: Manifest, allocator: Allocator) ![]u8 {        return try format.textAlloc(self, allocator);    }    pub fn scalarPatchesAlloc(        self: Manifest,        allocator: Allocator,        encoded: []const u8,        input_indexes: []const usize,        contribution_indexes: []const usize,        archive_member_indexes: []const usize,    ) ![]format.ManifestFieldPatch {        return format.manifestScalarPatchesAlloc(allocator, encoded, self, input_indexes, contribution_indexes, archive_member_indexes);    }    pub fn formatBinaryAlloc(self: Manifest, allocator: Allocator) ![]u8 {        return try format.binaryAlloc(self, allocator);    }    pub fn writeBinary(self: Manifest, writer: *std.Io.Writer) !void {        try format.writeBinary(self, writer);    }    pub fn writeText(self: Manifest, writer: *std.Io.Writer) std.Io.Writer.Error!void {        try format.writeText(self, writer);    }};

Source: lib/tldr/src/incremental/manifest.zig:208

zig
pub const MergePieceRecord = extern struct {    input_offset: u64 align(1),    size: u64 align(1),    address: u64 align(1),    input_index: u64 align(1),    input_name_id: u32 align(1),    ordinal: u32 align(1),};

Source: lib/tldr/src/incremental/manifest.zig:1053

zig
pub const PreparedState = struct {    manifest: Manifest,    contribution_index: ?ContributionIndex = null,    input_contributions: []InputContributionSummary = &.{},    pub const RecordUpdates = struct {        input_indexes: std.ArrayListUnmanaged(usize) = .empty,        contribution_indexes: std.ArrayListUnmanaged(usize) = .empty,        archive_member_indexes: std.ArrayListUnmanaged(usize) = .empty,        pub fn deinit(self: *RecordUpdates, allocator: Allocator) void {            self.input_indexes.deinit(allocator);            self.contribution_indexes.deinit(allocator);            self.archive_member_indexes.deinit(allocator);        }    };    pub fn fromOwnedManifest(allocator: Allocator, manifest: Manifest) Allocator.Error!PreparedState {        var owned_manifest = manifest;        errdefer owned_manifest.deinit(allocator);        const input_contributions = try buildInputContributionSummaries(allocator, owned_manifest);        errdefer if (input_contributions.len != 0) allocator.free(input_contributions);        return .{            .manifest = owned_manifest,            .input_contributions = input_contributions,        };    }    pub fn ensureReplacementIndex(        self: *PreparedState,        allocator: Allocator,        replacements: []const ReplacementContribution,    ) IndexError!void {        if (replacements.len == 0) return;        if (self.contribution_index) |*index| {            index.deinit(allocator);            self.contribution_index = null;        }        self.contribution_index = try ContributionIndex.initForReplacements(            allocator,            self.manifest,            replacements,        );    }    pub fn deinit(self: *PreparedState, allocator: Allocator) void {        if (self.contribution_index) |*index| index.deinit(allocator);        if (self.input_contributions.len != 0) allocator.free(self.input_contributions);        self.manifest.deinit(allocator);        self.* = undefined;    }    pub fn canReuseFor(self: *const PreparedState, options: model.LinkOptions, inputs: []const model.Input) bool {        return self.manifest.canReuseFor(options, inputs);    }    pub fn classifyInputs(        self: *const PreparedState,        storage: *InputChangeStorage,        inputs: []const model.Input,    ) InputChangeStorage.Exhaustion!InputChanges {        return try storage.classify(RecordedInputs.fromManifest(&self.manifest), inputs);    }    pub fn contributionSummaryForInput(self: *const PreparedState, recorded_index: usize) InputContributionSummary {        if (recorded_index >= self.input_contributions.len) return .{};        return self.input_contributions[recorded_index];    }    pub fn contributionSummaryForChange(self: *const PreparedState, change: InputChange) InputContributionSummary {        const recorded_index = change.recorded_index orelse return .{};        return self.contributionSummaryForInput(recorded_index);    }    fn relinkPreconditionPlan(self: *const PreparedState, options: model.LinkOptions) ?RelinkPlan {        if (options.incremental_mode == .off) {            return .{                .decision = .full_link,                .blocker = .incremental_disabled,            };        }        if (!self.manifest.input_hashes_recorded) {            return .{                .decision = .full_link,                .blocker = .input_hashes_unrecorded,            };        }        if (!self.manifest.canReuseOptions(options)) {            return .{                .decision = .full_link,                .blocker = .compatibility_mismatch,            };        }        return null;    }    pub fn planInputRelink(        self: *const PreparedState,        storage: *InputChangeStorage,        options: model.LinkOptions,        inputs: []const model.Input,    ) InputChangeStorage.Exhaustion!RelinkPlan {        if (self.relinkPreconditionPlan(options)) |plan| return plan;        const input_changes = try self.classifyInputs(storage, inputs);        return planRelinkFromInputChangesWithContributions(input_changes, self.input_contributions);    }    pub fn planChangedInputRelink(        self: *const PreparedState,        storage: *InputChangeStorage,        options: model.LinkOptions,        inputs: []const model.Input,        replacements: []const ReplacementContribution,    ) InputChangeStorage.Exhaustion!RelinkPlan {        if (self.relinkPreconditionPlan(options)) |plan| return plan;        const input_changes = try self.classifyInputs(storage, inputs);        return self.planChangedInputRelinkFromInputChanges(options, input_changes, replacements);    }    pub fn planChangedInputRelinkFromInputChanges(        self: *const PreparedState,        options: model.LinkOptions,        input_changes: InputChanges,        replacements: []const ReplacementContribution,    ) RelinkPlan {        if (self.relinkPreconditionPlan(options)) |plan| return plan;        return self.planChangedInputRelinkFromChanges(input_changes, replacements);    }    fn planChangedInputRelinkFromChanges(        self: *const PreparedState,        input_changes: InputChanges,        replacements: []const ReplacementContribution,    ) RelinkPlan {        if (input_changes.summary.added != 0 or input_changes.summary.removed != 0) {            for (input_changes.changes, 0..) |change, change_index| switch (change.kind) {                .unchanged, .changed => {},                .added => return .{                    .decision = .full_link,                    .blocker = .input_added,                    .blocking_change_index = change_index,                    .input_summary = input_changes.summary,                },                .removed => return .{                    .decision = .full_link,                    .blocker = .input_removed,                    .blocking_change_index = change_index,                    .input_summary = input_changes.summary,                    .affected_contributions = self.contributionSummaryForChange(change),                },            };        }        if (inputOrderDriftChangeIndex(input_changes)) |change_index| {            return .{                .decision = .full_link,                .blocker = .input_reordered,                .blocking_change_index = change_index,                .input_summary = input_changes.summary,                .affected_contributions = self.contributionSummaryForChange(input_changes.changes[change_index]),            };        }        if (input_changes.allUnchanged()) {            if (replacements.len == 0) {                return .{                    .decision = .reuse_output,                    .input_summary = input_changes.summary,                };            }            return self.replacementNotChangedPlan(input_changes, replacements, 0);        }        if (input_changes.changes.len <= replacement_accounting_index_limit) {            return self.planChangedInputRelinkFromIndexedChanges(input_changes, replacements);        }        return self.planChangedInputRelinkFromLinearChanges(input_changes, replacements);    }    fn planChangedInputRelinkFromLinearChanges(        self: *const PreparedState,        input_changes: InputChanges,        replacements: []const ReplacementContribution,    ) RelinkPlan {        var affected: InputContributionSummary = .{};        for (input_changes.changes, 0..) |change, change_index| {            switch (change.kind) {                .unchanged => {},                .added => return .{                    .decision = .full_link,                    .blocker = .input_added,                    .blocking_change_index = change_index,                    .input_summary = input_changes.summary,                },                .removed => return .{                    .decision = .full_link,                    .blocker = .input_removed,                    .blocking_change_index = change_index,                    .input_summary = input_changes.summary,                    .affected_contributions = self.contributionSummaryForChange(change),                },                .changed => {                    const contribution_summary = self.contributionSummaryForChange(change);                    addInputContributionSummary(&affected, contribution_summary);                    const recorded_index = change.recorded_index orelse {                        return .{                            .decision = .full_link,                            .blocker = .replacement_missing,                            .blocking_change_index = change_index,                            .input_summary = input_changes.summary,                            .affected_contributions = contribution_summary,                        };                    };                    if (countRetainedReplacementsForInput(replacements, recorded_index) != contribution_summary.retained) {                        return .{                            .decision = .full_link,                            .blocker = .replacement_missing,                            .blocking_change_index = change_index,                            .input_summary = input_changes.summary,                            .affected_contributions = contribution_summary,                        };                    }                },            }        }        if (replacementIndexOutsideChangedInputs(input_changes, replacements)) |replacement_index| {            return self.replacementNotChangedPlan(input_changes, replacements, replacement_index);        }        return self.planReplacementRelinkFromChanges(input_changes, replacements, affected);    }    fn planChangedInputRelinkFromIndexedChanges(        self: *const PreparedState,        input_changes: InputChanges,        replacements: []const ReplacementContribution,    ) RelinkPlan {        var recorded_change_indexes_storage = @as([replacement_accounting_index_limit]?usize, @splat(null));        var replacement_counts_storage = @as([replacement_accounting_index_limit]usize, @splat(0));        const recorded_change_indexes = recorded_change_indexes_storage[0..input_changes.changes.len];        const replacement_counts = replacement_counts_storage[0..input_changes.changes.len];        @memset(recorded_change_indexes, null);        @memset(replacement_counts, 0);        var affected: InputContributionSummary = .{};        for (input_changes.changes, 0..) |change, change_index| {            switch (change.kind) {                .unchanged => {},                .added => return .{                    .decision = .full_link,                    .blocker = .input_added,                    .blocking_change_index = change_index,                    .input_summary = input_changes.summary,                },                .removed => return .{                    .decision = .full_link,                    .blocker = .input_removed,                    .blocking_change_index = change_index,                    .input_summary = input_changes.summary,                    .affected_contributions = self.contributionSummaryForChange(change),                },                .changed => {                    const contribution_summary = self.contributionSummaryForChange(change);                    addInputContributionSummary(&affected, contribution_summary);                    const recorded_index = change.recorded_index orelse {                        return .{                            .decision = .full_link,                            .blocker = .replacement_missing,                            .blocking_change_index = change_index,                            .input_summary = input_changes.summary,                            .affected_contributions = contribution_summary,                        };                    };                    if (recorded_index >= recorded_change_indexes.len) {                        return .{                            .decision = .full_link,                            .blocker = .replacement_missing,                            .blocking_change_index = change_index,                            .input_summary = input_changes.summary,                            .affected_contributions = contribution_summary,                        };                    }                    recorded_change_indexes[recorded_index] = change_index;                },            }        }        var first_outside_replacement_index: ?usize = null;        for (replacements, 0..) |replacement, replacement_index| {            if (replacement.input_index >= recorded_change_indexes.len) {                if (first_outside_replacement_index == null) first_outside_replacement_index = replacement_index;                continue;            }            const change_index = recorded_change_indexes[replacement.input_index] orelse {                if (first_outside_replacement_index == null) first_outside_replacement_index = replacement_index;                continue;            };            if (input_changes.changes[change_index].kind != .changed) {                if (first_outside_replacement_index == null) first_outside_replacement_index = replacement_index;                continue;            }            replacement_counts[replacement.input_index] += 1;        }        for (input_changes.changes, 0..) |change, change_index| {            if (change.kind != .changed) continue;            const recorded_index = change.recorded_index orelse continue;            const contribution_summary = self.contributionSummaryForChange(change);            if (recorded_index >= replacement_counts.len or replacement_counts[recorded_index] != contribution_summary.retained) {                return .{                    .decision = .full_link,                    .blocker = .replacement_missing,                    .blocking_change_index = change_index,                    .input_summary = input_changes.summary,                    .affected_contributions = contribution_summary,                };            }        }        if (first_outside_replacement_index) |replacement_index| {            return self.replacementNotChangedPlan(input_changes, replacements, replacement_index);        }        return self.planReplacementRelinkFromChanges(input_changes, replacements, affected);    }    fn replacementNotChangedPlan(        self: *const PreparedState,        input_changes: InputChanges,        replacements: []const ReplacementContribution,        replacement_index: usize,    ) RelinkPlan {        const blocking_change_index = if (replacement_index < replacements.len)            changeIndexForRecordedInput(input_changes, replacements[replacement_index].input_index)        else            null;        return .{            .decision = .full_link,            .blocker = .replacement_not_changed,            .blocking_change_index = blocking_change_index,            .blocking_replacement_index = replacement_index,            .input_summary = input_changes.summary,            .affected_contributions = if (blocking_change_index) |change_index|                self.contributionSummaryForChange(input_changes.changes[change_index])            else                .{},        };    }    fn planReplacementRelinkFromChanges(        self: *const PreparedState,        input_changes: InputChanges,        replacements: []const ReplacementContribution,        affected: InputContributionSummary,    ) RelinkPlan {        const patch_plan = self.planContributionReplacement(replacements);        if (patch_plan.decision == .in_place) {            return .{                .decision = .in_place,                .input_summary = input_changes.summary,                .affected_contributions = affected,            };        }        const blocking_replacement_index = patch_plan.blocking_index;        const blocking_change_index = if (blocking_replacement_index) |replacement_index|            if (replacement_index < replacements.len)                changeIndexForRecordedInput(input_changes, replacements[replacement_index].input_index)            else                null        else            null;        return .{            .decision = .full_link,            .blocker = relinkBlockerForPatchBlocker(patch_plan.blocker),            .blocking_change_index = blocking_change_index,            .blocking_replacement_index = blocking_replacement_index,            .input_summary = input_changes.summary,            .affected_contributions = if (blocking_change_index) |change_index|                self.contributionSummaryForChange(input_changes.changes[change_index])            else                affected,        };    }    pub fn planContributionReplacement(        self: *const PreparedState,        replacements: []const ReplacementContribution,    ) PatchPlan {        if (self.contribution_index) |index| {            return index.planContributionReplacement(self.manifest, replacements);        }        return patch.planContributionReplacement(self.manifest, replacements);    }    fn contributionIndexForReplacement(        self: *const PreparedState,        cursor: *patch.ContributionCursor,        replacement: ReplacementContribution,    ) ?usize {        if (self.contribution_index) |index| return index.contributionIndexForReplacement(replacement);        const match = cursor.find(self.manifest, replacement) orelse return null;        return match.index;    }    pub fn applyChangedInputRelink(        self: *const PreparedState,        storage: *InputChangeStorage,        image: []u8,        options: model.LinkOptions,        inputs: []const model.Input,        replacements: []const ReplacementContribution,    ) RelinkApplyError!RelinkApplication {        if (self.relinkPreconditionPlan(options)) |plan| return .{ .plan = plan };        const input_changes = try self.classifyInputs(storage, inputs);        return try self.applyChangedInputRelinkFromInputChanges(options, input_changes, image, replacements);    }    pub fn applyChangedInputRelinkFromCandidate(        self: *const PreparedState,        allocator: Allocator,        storage: *InputChangeStorage,        image: []u8,        options: model.LinkOptions,        inputs: []const model.Input,        candidate_image: []const u8,        candidate_manifest: Manifest,    ) CandidateRelinkApplyError!RelinkApplication {        if (self.relinkPreconditionPlan(options)) |plan| return .{ .plan = plan };        const input_changes = try self.classifyInputs(storage, inputs);        const replacements = try replacementContributionsFromImage(            allocator,            candidate_image,            candidate_manifest,            input_changes,        );        defer freeReplacementContributions(allocator, replacements);        return try self.applyChangedInputRelinkFromChanges(input_changes, image, replacements);    }    pub fn applyChangedInputRelinkFromInputChanges(        self: *const PreparedState,        options: model.LinkOptions,        input_changes: InputChanges,        image: []u8,        replacements: []const ReplacementContribution,    ) PatchApplyError!RelinkApplication {        if (self.relinkPreconditionPlan(options)) |plan| return .{ .plan = plan };        return try self.applyChangedInputRelinkFromChanges(input_changes, image, replacements);    }    fn applyChangedInputRelinkFromChanges(        self: *const PreparedState,        input_changes: InputChanges,        image: []u8,        replacements: []const ReplacementContribution,    ) PatchApplyError!RelinkApplication {        const plan = self.planChangedInputRelinkFromChanges(input_changes, replacements);        return try self.applyAcceptedChangedInputRelink(image, replacements, plan);    }    pub fn acceptedRelinkRecordUpdates(        self: *const PreparedState,        allocator: Allocator,        inputs: []const model.Input,        input_changes: InputChanges,        replacements: []const ReplacementContribution,        member_updates: []const MemberHashUpdate,    ) !RecordUpdates {        var updates = RecordUpdates{};        errdefer updates.deinit(allocator);        for (input_changes.changes) |change| {            const recorded_index = change.recorded_index orelse continue;            const current_index = change.current_index orelse continue;            if (recorded_index >= self.manifest.inputs.len or current_index >= inputs.len) continue;            try updates.input_indexes.append(allocator, recorded_index);        }        var cursor = patch.ContributionCursor{};        for (replacements) |replacement| {            const contribution_index = self.contributionIndexForReplacement(&cursor, replacement) orelse                return error.ReplacementMissing;            if (contribution_index >= self.manifest.contributions.len) return error.ReplacementMissing;            try updates.contribution_indexes.append(allocator, contribution_index);        }        for (member_updates) |update| {            if (update.member_index >= self.manifest.archive_members.len) return error.MemberMissing;            try updates.archive_member_indexes.append(allocator, update.member_index);        }        return updates;    }    pub fn replacementFileRange(        self: *const PreparedState,        replacement: ReplacementContribution,    ) ?patch.FileRange {        var cursor = patch.ContributionCursor{};        const contribution_index = self.contributionIndexForReplacement(&cursor, replacement) orelse return null;        if (contribution_index >= self.manifest.contributions.len) return null;        return patch.replacementFileRange(self.manifest.contributions[contribution_index], replacement);    }    pub fn applyAcceptedChangedInputRelink(        self: *const PreparedState,        image: []u8,        replacements: []const ReplacementContribution,        accepted_plan: RelinkPlan,    ) PatchApplyError!RelinkApplication {        var application = RelinkApplication{            .plan = accepted_plan,        };        if (accepted_plan.decision != .in_place) return application;        const patch_application = try self.applyContributionReplacementInPlace(image, replacements);        if (patch_application.plan.decision == .full_link) {            application.plan = .{                .decision = .full_link,                .blocker = relinkBlockerForPatchBlocker(patch_application.plan.blocker),                .blocking_replacement_index = patch_application.plan.blocking_index,                .input_summary = accepted_plan.input_summary,                .affected_contributions = accepted_plan.affected_contributions,            };            return application;        }        application.contributions_written = patch_application.contributions_written;        application.bytes_written = patch_application.bytes_written;        application.zero_fill_bytes = patch_application.zero_fill_bytes;        return application;    }    pub fn applyContributionReplacement(        self: *const PreparedState,        image: []u8,        replacements: []const ReplacementContribution,    ) PatchApplyError!PatchApplication {        if (self.contribution_index) |index| {            return try index.applyContributionReplacement(image, self.manifest, replacements);        }        return try patch.applyContributionReplacement(self.manifest, image, replacements);    }    fn applyContributionReplacementInPlace(        self: *const PreparedState,        image: []u8,        replacements: []const ReplacementContribution,    ) PatchApplyError!PatchApplication {        if (self.contribution_index) |index| {            return try index.applyContributionReplacementInPlace(image, self.manifest, replacements);        }        return try patch.applyContributionReplacementInPlace(self.manifest, image, replacements);    }    pub fn updateManifestForChangedInputRelinkFromInputChanges(        self: *PreparedState,        inputs: []const model.Input,        input_changes: InputChanges,        replacements: []const ReplacementContribution,        member_updates: []const MemberHashUpdate,        inputs_read_at_ns: i64,    ) RelinkManifestUpdateError!void {        if (!self.manifest.input_hashes_recorded) return error.RelinkUpdateRequiresInPlacePlan;        const plan = self.planChangedInputRelinkFromChanges(input_changes, replacements);        try self.updateManifestForAcceptedChangedInputRelinkFromInputChanges(            inputs,            input_changes,            replacements,            member_updates,            inputs_read_at_ns,            plan,        );    }    pub fn updateManifestForAcceptedChangedInputRelinkFromInputChanges(        self: *PreparedState,        inputs: []const model.Input,        input_changes: InputChanges,        replacements: []const ReplacementContribution,        member_updates: []const MemberHashUpdate,        inputs_read_at_ns: i64,        accepted_plan: RelinkPlan,    ) RelinkManifestUpdateError!void {        if (!self.manifest.input_hashes_recorded) return error.RelinkUpdateRequiresInPlacePlan;        if (accepted_plan.decision != .in_place) return error.RelinkUpdateRequiresInPlacePlan;        for (input_changes.changes) |change| {            const recorded_index = change.recorded_index orelse continue;            const current_index = change.current_index orelse continue;            if (recorded_index >= self.manifest.inputs.len or current_index >= inputs.len) continue;            const input = inputs[current_index];            const identity = input.identity orelse model.InputIdentity{ .mtime_ns = 0, .inode = 0 };            self.manifest.inputs[recorded_index].size = input.bytes.len;            self.manifest.inputs[recorded_index].hash = hashBytes(input.bytes);            self.manifest.inputs[recorded_index].mtime_ns = identity.mtime_ns;            self.manifest.inputs[recorded_index].inode = identity.inode;            self.manifest.inputs[recorded_index].identity_recorded = input.identity != null;        }        self.manifest.inputs_read_at_ns = inputs_read_at_ns;        var cursor = patch.ContributionCursor{};        for (replacements) |replacement| {            const contribution_index = self.contributionIndexForReplacement(&cursor, replacement) orelse                return error.ReplacementMissing;            if (contribution_index >= self.manifest.contributions.len) return error.ReplacementMissing;            const previous_file_size = self.manifest.contributions[contribution_index].file_size;            self.manifest.contributions[contribution_index].size = replacement.size;            self.manifest.contributions[contribution_index].file_size = if (previous_file_size == 0 and replacement.payload.len == 0)                0            else                replacement.size;        }        for (member_updates) |update| {            if (update.member_index >= self.manifest.archive_members.len) return error.MemberMissing;            self.manifest.archive_members[update.member_index].hash = update.hash;        }    }    pub fn updateManifestForCandidateRelink(        self: *PreparedState,        allocator: Allocator,        storage: *InputChangeStorage,        inputs: []const model.Input,        replacements: []const ReplacementContribution,        candidate_manifest: Manifest,    ) RelinkManifestClassifyError!void {        const input_changes = try self.classifyInputs(storage, inputs);        try self.updateManifestForCandidateRelinkFromInputChanges(allocator, inputs, input_changes, replacements, candidate_manifest);    }    pub fn updateManifestForCandidateRelinkFromInputChanges(        self: *PreparedState,        allocator: Allocator,        inputs: []const model.Input,        input_changes: InputChanges,        replacements: []const ReplacementContribution,        candidate_manifest: Manifest,    ) RelinkManifestUpdateError!void {        const plan = self.planChangedInputRelinkFromChanges(input_changes, replacements);        try self.updateManifestForAcceptedCandidateRelinkFromInputChanges(            allocator,            inputs,            input_changes,            replacements,            candidate_manifest,            plan,        );    }    pub fn updateManifestForAcceptedCandidateRelinkFromInputChanges(        self: *PreparedState,        allocator: Allocator,        inputs: []const model.Input,        input_changes: InputChanges,        replacements: []const ReplacementContribution,        candidate_manifest: Manifest,        accepted_plan: RelinkPlan,    ) RelinkManifestUpdateError!void {        try self.validateCandidateSectionLayout(candidate_manifest);        try self.updateManifestForAcceptedChangedInputRelinkFromInputChanges(            inputs,            input_changes,            replacements,            &.{},            candidate_manifest.inputs_read_at_ns,            accepted_plan,        );        for (self.manifest.sections, 0..) |*section, section_index| {            section.size = candidate_manifest.sections[section_index].size;        }        try self.updateInputLinkHashesFromCandidate(input_changes, candidate_manifest);        try self.replaceDiscardedContributionsFromCandidate(allocator, input_changes, candidate_manifest);        try self.replaceExternalTargetsFromCandidate(allocator, candidate_manifest);        try self.replaceArchiveMembersFromCandidate(allocator, input_changes, candidate_manifest);        try self.replaceGotEntriesFromCandidate(allocator, input_changes, candidate_manifest);        try self.replaceMergePiecesFromCandidate(allocator, input_changes, candidate_manifest);        try self.rebuildInputContributionSummaries(allocator);    }    fn updateInputLinkHashesFromCandidate(        self: *PreparedState,        input_changes: InputChanges,        candidate_manifest: Manifest,    ) RelinkManifestUpdateError!void {        for (input_changes.changes) |change| {            const recorded_index = change.recorded_index orelse continue;            const current_index = change.current_index orelse continue;            if (recorded_index >= self.manifest.inputs.len or current_index >= candidate_manifest.inputs.len) return error.SectionLayoutChanged;            self.manifest.inputs[recorded_index].link_hash = candidate_manifest.inputs[current_index].link_hash;            self.manifest.inputs[recorded_index].selection_hash = candidate_manifest.inputs[current_index].selection_hash;        }    }    fn validateCandidateSectionLayout(        self: *const PreparedState,        candidate_manifest: Manifest,    ) error{SectionLayoutChanged}!void {        if (self.manifest.sections.len != candidate_manifest.sections.len) return error.SectionLayoutChanged;        for (self.manifest.sections, candidate_manifest.sections) |recorded, candidate| {            if (!std.mem.eql(u8, self.manifest.string(recorded.name_id), candidate_manifest.string(candidate.name_id))) return error.SectionLayoutChanged;            if (recorded.address != candidate.address) return error.SectionLayoutChanged;            if (recorded.file_offset != candidate.file_offset) return error.SectionLayoutChanged;            if (recorded.reserved_size != candidate.reserved_size) return error.SectionLayoutChanged;            if (recorded.alignment != candidate.alignment) return error.SectionLayoutChanged;        }    }    fn replaceDiscardedContributionsFromCandidate(        self: *PreparedState,        allocator: Allocator,        input_changes: InputChanges,        candidate_manifest: Manifest,    ) RelinkManifestUpdateError!void {        const discarded_contributions = try cloneCandidateDiscardedContributions(            allocator,            &self.manifest.strings,            input_changes,            candidate_manifest,        );        errdefer if (discarded_contributions.len != 0) allocator.free(discarded_contributions);        if (self.manifest.owned.discarded_contributions and self.manifest.discarded_contributions.len != 0) {            allocator.free(self.manifest.discarded_contributions);        }        self.manifest.discarded_contributions = discarded_contributions;        self.manifest.owned.discarded_contributions = true;    }    fn replaceArchiveMembersFromCandidate(        self: *PreparedState,        allocator: Allocator,        input_changes: InputChanges,        candidate_manifest: Manifest,    ) RelinkManifestUpdateError!void {        const archive_members = try cloneArchiveMemberRecords(allocator, &self.manifest.strings, input_changes, candidate_manifest);        errdefer if (archive_members.len != 0) allocator.free(archive_members);        if (self.manifest.owned.archive_members and self.manifest.archive_members.len != 0) {            allocator.free(self.manifest.archive_members);        }        self.manifest.archive_members = archive_members;        self.manifest.owned.archive_members = true;    }    fn replaceGotEntriesFromCandidate(        self: *PreparedState,        allocator: Allocator,        input_changes: InputChanges,        candidate_manifest: Manifest,    ) RelinkManifestUpdateError!void {        const got_entries = try cloneGotEntryRecords(allocator, &self.manifest.strings, input_changes, candidate_manifest);        errdefer if (got_entries.len != 0) allocator.free(got_entries);        if (self.manifest.owned.got_entries and self.manifest.got_entries.len != 0) {            allocator.free(self.manifest.got_entries);        }        self.manifest.got_entries = got_entries;        self.manifest.owned.got_entries = true;    }    fn replaceMergePiecesFromCandidate(        self: *PreparedState,        allocator: Allocator,        input_changes: InputChanges,        candidate_manifest: Manifest,    ) RelinkManifestUpdateError!void {        const merge_pieces = try cloneMergePieceRecords(allocator, &self.manifest.strings, input_changes, candidate_manifest);        errdefer if (merge_pieces.len != 0) allocator.free(merge_pieces);        if (self.manifest.owned.merge_pieces and self.manifest.merge_pieces.len != 0) {            allocator.free(self.manifest.merge_pieces);        }        self.manifest.merge_pieces = merge_pieces;        self.manifest.owned.merge_pieces = true;    }    fn replaceExternalTargetsFromCandidate(        self: *PreparedState,        allocator: Allocator,        candidate_manifest: Manifest,    ) Allocator.Error!void {        const external_targets = try cloneExternalTargetRecords(allocator, &self.manifest.strings, candidate_manifest);        errdefer if (external_targets.len != 0) allocator.free(external_targets);        if (self.manifest.owned.external_targets and self.manifest.external_targets.len != 0) {            allocator.free(self.manifest.external_targets);        }        self.manifest.external_targets = external_targets;        self.manifest.owned.external_targets = true;    }    fn rebuildInputContributionSummaries(        self: *PreparedState,        allocator: Allocator,    ) Allocator.Error!void {        const input_contributions = try buildInputContributionSummaries(allocator, self.manifest);        if (self.input_contributions.len != 0) allocator.free(self.input_contributions);        self.input_contributions = input_contributions;    }};

Source: lib/tldr/src/incremental/manifest.zig:900

zig
pub const RecordOwnership = packed struct {    inputs: bool = false,    sections: bool = false,    contributions: bool = false,    discarded_contributions: bool = false,    external_targets: bool = false,    archive_members: bool = false,    got_entries: bool = false,    merge_pieces: bool = false,};

Source: lib/tldr/src/incremental/manifest.zig:277

zig
/// This struct borrows the parts of a manifest (the record a prepared link/// keeps beside its output) that input classification (matching current inputs/// to recorded ones by name) reads: the input records, the time the inputs were/// read, and the string tables that hold input names. Callers build one with/// `fromManifest` and pass it to `classify`. Classification through this struct/// allocates nothing. The struct points into the arrays of the manifest, so the/// instance stays valid only while that manifest is alive and gains no new/// strings.pub const RecordedInputs = struct {    inputs: []const InputRecord,    inputs_read_at_ns: i64,    spans: []const StringSpan,    blob: []const u8,    appendix_spans: []const StringSpan,    appendix: []const u8,    pub fn fromManifest(manifest: *const Manifest) RecordedInputs {        return .{            .inputs = manifest.inputs,            .inputs_read_at_ns = manifest.inputs_read_at_ns,            .spans = manifest.strings.spans,            .blob = manifest.strings.blob,            .appendix_spans = manifest.strings.appendix_spans.items,            .appendix = manifest.strings.appendix.items,        };    }    pub fn string(self: RecordedInputs, id: u32) []const u8 {        const string_count = std.math.add(            usize,            self.spans.len,            self.appendix_spans.len,        ) catch unreachable;        std.debug.assert(id < string_count);        if (id < self.spans.len) {            const span = self.spans[id];            return self.blob[span.offset..][0..span.len];        }        const span = self.appendix_spans[id - self.spans.len];        return self.appendix[span.offset..][0..span.len];    }};

Source: lib/tldr/src/incremental/manifest.zig:890

zig
pub const RelinkApplication = struct {    plan: RelinkPlan,    contributions_written: usize = 0,    bytes_written: usize = 0,    zero_fill_bytes: usize = 0,};

Source: lib/tldr/src/incremental/manifest.zig:836

zig
pub const RelinkBlocker = enum {    incremental_disabled,    input_hashes_unrecorded,    compatibility_mismatch,    input_changed,    input_added,    input_removed,    input_reordered,    replacement_missing,    replacement_not_changed,    replacement_unpatchable,    replacement_layout_changed,    replacement_grew_past_reserve,    replacement_alignment_increased,};

Source: lib/tldr/src/incremental/manifest.zig:830

zig
pub const RelinkDecision = enum {    reuse_output,    in_place,    full_link,};

Source: lib/tldr/src/incremental/manifest.zig:852

zig
pub const RelinkPlan = struct {    decision: RelinkDecision,    blocker: ?RelinkBlocker = null,    blocking_change_index: ?usize = null,    blocking_replacement_index: ?usize = null,    input_summary: InputChangeSummary = .{},    affected_contributions: InputContributionSummary = .{},};

Source: lib/tldr/src/incremental/manifest.zig:119

zig
pub const SectionRecord = extern struct {    address: u64 align(1),    file_offset: u64 align(1),    size: u64 align(1),    reserved_size: u64 align(1),    alignment: u64 align(1),    name_id: u32 align(1),};

Source: lib/tldr/src/incremental/manifest.zig:10

zig
pub const StringSpan = extern struct {    offset: u32 align(1),    len: u32 align(1),};

Source: lib/tldr/src/incremental/manifest.zig:15

zig
pub const Strings = struct {    spans: []const StringSpan = &.{},    blob: []const u8 = &.{},    owned: bool = false,    appendix_spans: std.ArrayListUnmanaged(StringSpan) = .empty,    appendix: std.ArrayListUnmanaged(u8) = .empty,    ids: IdMap = .empty,    const IdMap: type = std.HashMapUnmanaged(u32, void, IdContext, 80);    const IdContext = struct {        strings: *const Strings,        pub fn hash(context: IdContext, id: u32) u64 {            return std.hash.Wyhash.hash(0, context.strings.get(id));        }        pub fn eql(context: IdContext, a: u32, b: u32) bool {            if (a == b) return true;            return std.mem.eql(u8, context.strings.get(a), context.strings.get(b));        }    };    const BytesContext = struct {        strings: *const Strings,        pub fn hash(context: BytesContext, bytes: []const u8) u64 {            _ = context;            return std.hash.Wyhash.hash(0, bytes);        }        pub fn eql(context: BytesContext, bytes: []const u8, id: u32) bool {            return std.mem.eql(u8, bytes, context.strings.get(id));        }    };    pub fn deinit(self: *Strings, allocator: Allocator) void {        if (self.owned) {            if (self.spans.len != 0) allocator.free(self.spans);            if (self.blob.len != 0) allocator.free(self.blob);        }        self.appendix_spans.deinit(allocator);        self.appendix.deinit(allocator);        self.ids.deinit(allocator);        self.* = .{};    }    pub fn count(self: *const Strings) usize {        return self.spans.len + self.appendix_spans.items.len;    }    pub fn get(self: *const Strings, id: u32) []const u8 {        if (id < self.spans.len) {            const span = self.spans[id];            return self.blob[span.offset..][0..span.len];        }        const span = self.appendix_spans.items[id - self.spans.len];        return self.appendix.items[span.offset..][0..span.len];    }    pub fn intern(self: *Strings, allocator: Allocator, bytes: []const u8) Allocator.Error!u32 {        if (self.ids.size == 0 and self.count() != 0) try self.rebuildIds(allocator);        const gop = try self.ids.getOrPutContextAdapted(            allocator,            bytes,            BytesContext{ .strings = self },            IdContext{ .strings = self },        );        if (gop.found_existing) return gop.key_ptr.*;        errdefer self.ids.removeByPtr(gop.key_ptr);        const id = std.math.cast(u32, self.count()) orelse return error.OutOfMemory;        const offset = std.math.cast(u32, self.appendix.items.len) orelse return error.OutOfMemory;        const len = std.math.cast(u32, bytes.len) orelse return error.OutOfMemory;        try self.appendix.appendSlice(allocator, bytes);        errdefer self.appendix.shrinkRetainingCapacity(offset);        try self.appendix_spans.append(allocator, .{ .offset = offset, .len = len });        gop.key_ptr.* = id;        return id;    }    fn rebuildIds(self: *Strings, allocator: Allocator) Allocator.Error!void {        const total = std.math.cast(u32, self.count()) orelse return error.OutOfMemory;        try self.ids.ensureTotalCapacityContext(allocator, total, IdContext{ .strings = self });        var id: u32 = 0;        while (id < total) : (id += 1) {            const gop = self.ids.getOrPutAssumeCapacityContext(id, IdContext{ .strings = self });            if (!gop.found_existing) gop.key_ptr.* = id;        }    }};

Source: lib/tldr/src/incremental/patch.zig:179

zig
pub const ContributionIndex = struct {    map: ContributionIndexMap = .empty,    pub fn init(allocator: Allocator, manifest: Manifest) IndexError!ContributionIndex {        var index = ContributionIndex{};        errdefer index.deinit(allocator);        try index.map.ensureTotalCapacity(allocator, @intCast(manifest.contributions.len));        for (manifest.contributions, 0..) |contribution, contribution_index| {            const gop = index.map.getOrPutAssumeCapacityContext(                ContributionKey.fromRecord(manifest, contribution),                contribution_key_context,            );            if (gop.found_existing) return error.DuplicateContribution;            gop.value_ptr.* = contribution_index;        }        return index;    }    pub fn initForReplacements(        allocator: Allocator,        manifest: Manifest,        replacements: []const ReplacementContribution,    ) IndexError!ContributionIndex {        var index = ContributionIndex{};        errdefer index.deinit(allocator);        if (replacements.len == 0 or manifest.contributions.len == 0) return index;        var max_input_index: usize = 0;        for (manifest.contributions) |contribution| {            max_input_index = @max(max_input_index, contribution.input_index);        }        var inputs = try std.DynamicBitSetUnmanaged.initEmpty(allocator, max_input_index + 1);        defer inputs.deinit(allocator);        for (replacements) |replacement| {            if (replacement.input_index <= max_input_index) inputs.set(replacement.input_index);        }        var filtered: usize = 0;        for (manifest.contributions) |contribution| {            if (inputs.isSet(contribution.input_index)) filtered += 1;        }        if (filtered == 0) return index;        try index.map.ensureTotalCapacity(allocator, @intCast(filtered));        for (manifest.contributions, 0..) |contribution, contribution_index| {            if (!inputs.isSet(contribution.input_index)) continue;            const gop = index.map.getOrPutAssumeCapacityContext(                ContributionKey.fromRecord(manifest, contribution),                contribution_key_context,            );            if (gop.found_existing) return error.DuplicateContribution;            gop.value_ptr.* = contribution_index;        }        return index;    }    pub fn deinit(self: *ContributionIndex, allocator: Allocator) void {        self.map.deinit(allocator);        self.* = .{};    }    pub fn contributionIndexForReplacement(self: ContributionIndex, replacement: ReplacementContribution) ?usize {        return self.map.getContext(            ContributionKey.fromReplacement(replacement),            contribution_key_context,        );    }    pub fn planContributionReplacement(        self: ContributionIndex,        manifest: Manifest,        replacements: []const ReplacementContribution,    ) PatchPlan {        for (replacements, 0..) |replacement, replacement_index| {            const contribution_index = self.contributionIndexForReplacement(replacement) orelse return .{                .decision = .full_link,                .blocker = .missing_contribution,                .blocking_index = replacement_index,            };            if (contribution_index >= manifest.contributions.len) {                return .{                    .decision = .full_link,                    .blocker = .missing_contribution,                    .blocking_index = replacement_index,                };            }            const record = manifest.contributions[contribution_index];            if (!contribution_key_context.eql(ContributionKey.fromRecord(manifest, record), ContributionKey.fromReplacement(replacement))) {                return .{                    .decision = .full_link,                    .blocker = .missing_contribution,                    .blocking_index = replacement_index,                };            }            if (blockerForRecord(manifest, record, replacement, replacement_index)) |plan| {                return plan;            }        }        return .{ .decision = .in_place };    }    pub fn applyContributionReplacement(        self: ContributionIndex,        image: []u8,        manifest: Manifest,        replacements: []const ReplacementContribution,    ) PatchApplyError!PatchApplication {        var application = PatchApplication{            .plan = self.planContributionReplacement(manifest, replacements),        };        if (application.plan.decision == .full_link) return application;        for (replacements, 0..) |replacement, replacement_index| {            const contribution_index = self.contributionIndexForReplacement(replacement) orelse {                application.plan = .{                    .decision = .full_link,                    .blocker = .missing_contribution,                    .blocking_index = replacement_index,                };                return application;            };            if (contribution_index >= manifest.contributions.len) {                application.plan = .{                    .decision = .full_link,                    .blocker = .missing_contribution,                    .blocking_index = replacement_index,                };                return application;            }            try applyReplacementBytes(                image,                manifest.contributions[contribution_index],                replacement,                &application,            );        }        return application;    }    pub fn applyContributionReplacementInPlace(        self: ContributionIndex,        image: []u8,        manifest: Manifest,        replacements: []const ReplacementContribution,    ) PatchApplyError!PatchApplication {        var application = PatchApplication{            .plan = .{ .decision = .in_place },        };        for (replacements, 0..) |replacement, replacement_index| {            const contribution_index = self.contributionIndexForReplacement(replacement) orelse {                application.plan = .{                    .decision = .full_link,                    .blocker = .missing_contribution,                    .blocking_index = replacement_index,                };                return application;            };            if (contribution_index >= manifest.contributions.len) {                application.plan = .{                    .decision = .full_link,                    .blocker = .missing_contribution,                    .blocking_index = replacement_index,                };                return application;            }            try applyReplacementBytes(                image,                manifest.contributions[contribution_index],                replacement,                &application,            );        }        return application;    }};

Source: lib/tldr/src/incremental/patch.zig:52

zig
pub const DirectRelinkEvidence = struct {    replacements: []const ReplacementContribution = &.{},    member_updates: []const MemberHashUpdate = &.{},    inputs_proven: bool = false,    pub fn deinit(self: DirectRelinkEvidence, allocator: Allocator) void {        freeReplacementContributions(allocator, self.replacements);        if (self.member_updates.len != 0) allocator.free(self.member_updates);    }};

Source: lib/tldr/src/incremental/patch.zig:26

zig
pub const FileRange = struct {    offset: usize,    len: usize,};

Source: lib/tldr/src/incremental/patch.zig:47

zig
pub const MemberHashUpdate = struct {    member_index: usize,    hash: u64,};

Source: lib/tldr/src/incremental/patch.zig:82

zig
pub const PatchApplication = struct {    plan: PatchPlan,    contributions_written: usize = 0,    bytes_written: usize = 0,    zero_fill_bytes: usize = 0,};

Source: lib/tldr/src/incremental/patch.zig:89

zig
pub const PatchApplyError = error{    PatchPayloadMismatch,    PatchRangeOutOfBounds,};

Source: lib/tldr/src/incremental/patch.zig:68

zig
pub const PatchBlocker = enum {    missing_contribution,    unpatchable_contribution,    layout_changed,    grew_past_reserve,    alignment_increased,};

Source: lib/tldr/src/incremental/patch.zig:63

zig
pub const PatchDecision = enum {    in_place,    full_link,};

Source: lib/tldr/src/incremental/patch.zig:76

zig
pub const PatchPlan = struct {    decision: PatchDecision,    blocker: ?PatchBlocker = null,    blocking_index: ?usize = null,};

Source: lib/tldr/src/incremental/patch.zig:9

zig
pub const ReplacementContribution = struct {    input_name: []const u8,    input_index: usize,    kind: ContributionKind,    name: []const u8,    ordinal: u32,    size: u64,    alignment: u64,    output_section_name: ?[]const u8 = null,    address: ?u64 = null,    file_offset: ?u64 = null,    reserved_size: ?u64 = null,    payload: []const u8 = &.{},    payload_owned: bool = false,    unchanged: bool = false,};
Called byCallstest sourcelib.tldr.src.incremental.manifesttest: incremental manifest parses emi...test sourcelib.tldr.src.incremental.manifesttest: incremental manifest renders a ...incremental.Stringsinternincremental.BuilderaddArchiveMember
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallstest sourcelib.tldr.src.incremental.manifesttest: candidate relink full-links cha...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental manifest parses emi...+37 moreincremental.BuilderaddContributionWithFileSizeincremental.BuilderaddContribution
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.BuilderaddContributiontest sourcelib.tldr.src.incremental.manifesttest: candidate relink accepts filele...test sourcelib.tldr.src.incremental.manifesttest: prepared incremental state pres...incremental.Stringsinternincremental.BuilderaddContributionWithFileSize
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallstest sourcelib.tldr.src.incremental.manifesttest: incremental manifest parses emi...test sourcelib.tldr.src.incremental.manifesttest: incremental manifest renders a ...test sourcelib.tldr.src.incremental.manifesttest: incremental private manifest in...test sourcelib.tldr.src.incremental.manifesttest: prepared incremental state summ...test sourcelib.tldr.src.incremental.manifesttest: prepared incremental state upda...test sourcelib.tldr.src.incremental.manifesttest: prepared incremental state upda...incremental.Stringsinternincremental.BuilderaddDiscardedContribution
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallstest sourcelib.tldr.src.incremental.manifesttest: incremental manifest parses emi...test sourcelib.tldr.src.incremental.manifesttest: incremental manifest renders a ...test sourcelib.tldr.src.incremental.manifesttest: prepared incremental state refr...incremental.ExternalTargetRecordfromResolvedincremental.Stringsinternincremental.BuilderaddExternalTarget
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callersincremental.Stringsinternincremental.BuilderaddGotEntry
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsprivate sourcelib.tldr.src.incremental.manifestrepeatedInputManifesttest sourcelib.tldr.src.incremental.manifesttest: candidate relink accepts filele...test sourcelib.tldr.src.incremental.manifesttest: candidate relink full-links cha...test sourcelib.tldr.src.incremental.manifesttest: incremental manifest parses emi...test sourcelib.tldr.src.incremental.manifesttest: incremental manifest records co...+39 moreincremental.StringsinternincrementalhashBytesincremental.BuilderaddInput
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callersincremental.Stringsinternincremental.BuilderaddMergePiece
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallstest sourcelib.tldr.src.incremental.manifesttest: incremental manifest parses emi...test sourcelib.tldr.src.incremental.manifesttest: incremental manifest records co...test sourcelib.tldr.src.incremental.manifesttest: incremental manifest rejects ch...test sourcelib.tldr.src.incremental.manifesttest: incremental manifest renders a ...test sourcelib.tldr.src.incremental.manifesttest: incremental private manifest in...+2 moreincremental.Stringsinternincremental.BuilderaddSection
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsprivate sourcelib.tldr.src.incremental.manifestrepeatedInputManifesttest sourcelib.tldr.src.incremental.manifesttest: candidate relink accepts filele...test sourcelib.tldr.src.incremental.manifesttest: candidate relink full-links cha...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...+53 moreincremental.Stringsdeinitincremental.Builderdeinit
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsprivate sourcelib.tldr.src.incremental.manifestrepeatedInputManifesttest sourcelib.tldr.src.incremental.manifesttest: candidate relink accepts filele...test sourcelib.tldr.src.incremental.manifesttest: candidate relink full-links cha...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...+53 moreincremental.Builderfinish
Static calls · unresolved targets: 0 · external targets: 3.
Called byCallsNo direct callsprivate sourcelib.tldr.src.incremental.manifestrepeatedInputManifesttest sourcelib.tldr.src.incremental.manifesttest: candidate relink accepts filele...test sourcelib.tldr.src.incremental.manifesttest: candidate relink full-links cha...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...+53 moreincremental.Builderinit
Static calls · unresolved targets: 0 · external targets: 2.
Called byCallsNo direct callstest sourcelib.tldr.src.incremental.manifesttest: incremental manifest parses emi...incremental.BuildersetInputSelectionHash
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/tldr/src/incremental/manifest.zig:879

zig
pub const CandidateRelinkApplyError =    InputChangeStorage.Exhaustion || ReplacementExtractError || PatchApplyError;
Called byCallsNo direct callsincremental.BuilderaddExternalTargetincremental.ExternalTargetRecordfromResolved
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate sourcelib.tldr.src.formats.elf.relinkclassifyTestInputstest sourcelib.tldr.src.incremental.manifesttest: input change storage accepts an...test sourcelib.tldr.src.incremental.manifesttest: input change storage accepts ex...test sourcelib.tldr.src.incremental.manifesttest: input change storage acquisitio...test sourcelib.tldr.src.incremental.manifesttest: input change storage classifies...private sourcelib.tldr.src.incremental.manifest.InputChange...assertStorageincremental.InputChangeStorageactivate
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate sourcelib.tldr.src.formats.elf.relinkclassifyTestInputstest sourcelib.tldr.src.incremental.manifesttest: input change storage accepts an...test sourcelib.tldr.src.incremental.manifesttest: input change storage classifies...private sourcelib.tldr.src.incremental.manifest.InputChange...assertStorageprivate sourcelib.tldr.src.incremental.manifest.InputChange...classifyIndexedprivate sourcelib.tldr.src.incremental.manifest.InputChange...classifyLinearincremental.InputChangeStorageclassify
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate sourcelib.tldr.src.formats.elf.relink.TestInputClas...deinitprivate sourcelib.tldr.src.incremental.manifest.TestInputCh...deinittest sourcelib.tldr.src.incremental.manifesttest: input change storage accepts an...test sourcelib.tldr.src.incremental.manifesttest: input change storage accepts ex...test sourcelib.tldr.src.incremental.manifesttest: input change storage acquisitio...test sourcelib.tldr.src.incremental.manifesttest: input change storage classifies...private sourcelib.tldr.src.incremental.manifest.InputChange...assertStorageincremental.InputChangeStoragedeinit
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate sourcelib.tldr.src.formats.elf.relinkclassifyTestInputsprivate sourcelib.tldr.src.incremental.manifest.TestInputCh...inittest sourcelib.tldr.src.incremental.manifesttest: input change storage accepts an...test sourcelib.tldr.src.incremental.manifesttest: input change storage accepts ex...test sourcelib.tldr.src.incremental.manifesttest: input change storage acquisitio...test sourcelib.tldr.src.incremental.manifesttest: input change storage classifies...private sourcelib.tldr.src.incremental.manifestinputChangeSliceincremental.InputChangeStorageinit
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callsincremental.InputChangesallUnchangedincremental.InputChangeSummaryallUnchanged
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersincremental.InputChangeSummaryallUnchangedincremental.InputChangesallUnchanged
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.patchapplyContributionReplacementincremental.ManifestapplyContributionReplacement
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.PreparedStatecanReuseForincremental.ManifestcanReuseOptionsincremental.Manifeststringprivate sourcelib.tldr.src.incremental.manifestinputContentUnchangedincremental.ManifestcanReuseFor
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.ManifestcanReuseForprivate sourcelib.tldr.src.incremental.manifest.PreparedStaterelinkPreconditionPlanincremental.ManifestentrySymbolincremental.ManifestcanReuseOptions
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.PreparedStatedeinitincremental.Manifestemptyincremental.Stringsdeinitincremental.Manifestdeinit
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsincremental.Manifestdeinitincremental.Manifesttaketest sourcelib.tldr.src.incremental.manifesttest: prepared incremental state refr...test sourcelib.tldr.src.incremental.manifesttest: prepared incremental state upda...test sourcelib.tldr.src.incremental.manifesttest: prepared incremental state upda...incremental.Manifestempty
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.ManifestcanReuseOptionsincremental.Stringscountincremental.Stringsgetincremental.ManifestentrySymbol
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.formatbinaryAllocincremental.ManifestformatBinaryAlloc
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.formattextAllocincremental.ManifestformatTextAlloc
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.tldr.src.incremental.manifesttest: incremental manifest parses emi...test sourcelib.tldr.src.incremental.manifesttest: incremental private manifest in...test sourcelib.tldr.src.incremental.manifesttest: prepared incremental state refr...test sourcelib.tldr.src.incremental.manifesttest: prepared incremental state upda...private sourcelib.tldr.src.incremental.formatmanifestFromBinaryincremental.ManifestfromBinary
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.patchplanContributionReplacementincremental.ManifestplanContributionReplacement
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.formatmanifestScalarPatchesAllocincremental.ManifestscalarPatchesAlloc
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate sourcelib.tldr.src.formats.elf.relink.DirectRelocat...addMergePieceGroupprivate sourcelib.tldr.src.formats.elf.relink.DirectRelocat...appendUnchangedMemberReplacementsprivate sourcelib.tldr.src.formats.elf.relink.DirectRelocat...seedExternalTargetsprivate sourcelib.tldr.src.formats.elf.relink.DirectRelocat...seedGotEntriesincremental.ManifestcanReuseForprivate sourcelib.tldr.src.incremental.manifest.PreparedStatevalidateCandidateSectionLayoutincremental.Stringsgetincremental.Manifeststring
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersincremental.Manifestemptyincremental.Manifesttake
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.formatwriteBinaryincremental.ManifestwriteBinary
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.formatwriteTextincremental.ManifestwriteText
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.manifest.PreparedStatecontributionIndexForReplacementincremental.PreparedStateacceptedRelinkRecordUpdates
Static calls · unresolved targets: 3 · external targets: 1.
Called byCallsprivate sourcelib.tldr.src.incremental.manifest.PreparedStateapplyChangedInputRelinkFromChangesprivate sourcelib.tldr.src.incremental.manifest.PreparedStateapplyContributionReplacementInPlaceprivate sourcelib.tldr.src.incremental.manifestrelinkBlockerForPatchBlockerincremental.PreparedStateapplyAcceptedChangedInputRelink
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersincremental.PreparedStateapplyChangedInputRelinkFromInputChang...incremental.PreparedStateclassifyInputsprivate sourcelib.tldr.src.incremental.manifest.PreparedStaterelinkPreconditionPlanincremental.PreparedStateapplyChangedInputRelink
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.manifest.PreparedStateapplyChangedInputRelinkFromChangesincremental.PreparedStateclassifyInputsprivate sourcelib.tldr.src.incremental.manifest.PreparedStaterelinkPreconditionPlanincrementalreplacementContributionsFromImageincrementalfreeReplacementContributionsincremental.PreparedStateapplyChangedInputRelinkFromCandidate
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.PreparedStateapplyChangedInputRelinkprivate sourcelib.tldr.src.incremental.manifest.PreparedStateapplyChangedInputRelinkFromChangesprivate sourcelib.tldr.src.incremental.manifest.PreparedStaterelinkPreconditionPlanincremental.PreparedStateapplyChangedInputRelinkFromInputChang...
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.patchapplyContributionReplacementincremental.PreparedStateapplyContributionReplacement
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersincremental.ManifestcanReuseForincremental.PreparedStatecanReuseFor
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.PreparedStateapplyChangedInputRelinkincremental.PreparedStateapplyChangedInputRelinkFromCandidateincremental.PreparedStateplanChangedInputRelinkincremental.PreparedStateplanInputRelinkincremental.PreparedStateupdateManifestForCandidateRelinkincremental.RecordedInputsfromManifestincremental.PreparedStateclassifyInputs
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsprivate sourcelib.tldr.src.incremental.manifest.PreparedStateplanChangedInputRelinkFromChangesprivate sourcelib.tldr.src.incremental.manifest.PreparedStateplanChangedInputRelinkFromIndexedChan...private sourcelib.tldr.src.incremental.manifest.PreparedStateplanChangedInputRelinkFromLinearChang...private sourcelib.tldr.src.incremental.manifest.PreparedStateplanReplacementRelinkFromChangesprivate sourcelib.tldr.src.incremental.manifest.PreparedStatereplacementNotChangedPlanincremental.PreparedStatecontributionSummaryForInputincremental.PreparedStatecontributionSummaryForChange
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsincremental.PreparedStatecontributionSummaryForChangeincremental.PreparedStatecontributionSummaryForInput
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersincremental.Manifestdeinitincremental.PreparedStatedeinit
Static calls · unresolved targets: 0 · external targets: 2.
Called byCallsNo direct callersincremental.ContributionIndexinitForReplacementsincremental.PreparedStateensureReplacementIndex
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallstest sourcelib.tldr.src.incremental.manifesttest: candidate relink accepts filele...test sourcelib.tldr.src.incremental.manifesttest: candidate relink full-links cha...test sourcelib.tldr.src.incremental.manifesttest: input change classification mat...test sourcelib.tldr.src.incremental.manifesttest: input change classification pre...test sourcelib.tldr.src.incremental.manifesttest: input identity short-circuits c...+31 moreprivate sourcelib.tldr.src.incremental.manifestbuildInputContributionSummariesincremental.PreparedStatefromOwnedManifest
Static calls · unresolved targets: 0 · external targets: 2.
Called byCallsNo direct callersincremental.PreparedStateclassifyInputsincremental.PreparedStateplanChangedInputRelinkFromInputChangesprivate sourcelib.tldr.src.incremental.manifest.PreparedStaterelinkPreconditionPlanincremental.PreparedStateplanChangedInputRelink
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.PreparedStateplanChangedInputRelinkprivate sourcelib.tldr.src.incremental.manifest.PreparedStateplanChangedInputRelinkFromChangesprivate sourcelib.tldr.src.incremental.manifest.PreparedStaterelinkPreconditionPlanincremental.PreparedStateplanChangedInputRelinkFromInputChanges
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate sourcelib.tldr.src.incremental.manifest.PreparedStateplanReplacementRelinkFromChangesprivate sourcelib.tldr.src.incremental.patchplanContributionReplacementincremental.PreparedStateplanContributionReplacement
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersincremental.PreparedStateclassifyInputsprivate sourcelib.tldr.src.incremental.manifest.PreparedStaterelinkPreconditionPlanprivate sourcelib.tldr.src.incremental.manifestplanRelinkFromInputChangesWithContrib...incremental.PreparedStateplanInputRelink
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.manifest.PreparedStatecontributionIndexForReplacementprivate sourcelib.tldr.src.incremental.patchreplacementFileRangeincremental.PreparedStatereplacementFileRange
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.PreparedStateupdateManifestForCandidateRelinkFromI...private sourcelib.tldr.src.incremental.manifest.PreparedStaterebuildInputContributionSummariesprivate sourcelib.tldr.src.incremental.manifest.PreparedStatereplaceArchiveMembersFromCandidateprivate sourcelib.tldr.src.incremental.manifest.PreparedStatereplaceDiscardedContributionsFromCand...private sourcelib.tldr.src.incremental.manifest.PreparedStatereplaceExternalTargetsFromCandidateprivate sourcelib.tldr.src.incremental.manifest.PreparedStatereplaceGotEntriesFromCandidate+4 moreincremental.PreparedStateupdateManifestForAcceptedCandidateRel...
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.PreparedStateupdateManifestForAcceptedCandidateRel...incremental.PreparedStateupdateManifestForChangedInputRelinkFr...private sourcelib.tldr.src.incremental.manifest.PreparedStatecontributionIndexForReplacementincrementalhashBytesincremental.PreparedStateupdateManifestForAcceptedChangedInput...
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersincremental.PreparedStateclassifyInputsincremental.PreparedStateupdateManifestForCandidateRelinkFromI...incremental.PreparedStateupdateManifestForCandidateRelink
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.PreparedStateupdateManifestForCandidateRelinkprivate sourcelib.tldr.src.incremental.manifest.PreparedStateplanChangedInputRelinkFromChangesincremental.PreparedStateupdateManifestForAcceptedCandidateRel...incremental.PreparedStateupdateManifestForCandidateRelinkFromI...
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.manifest.PreparedStateplanChangedInputRelinkFromChangesincremental.PreparedStateupdateManifestForAcceptedChangedInput...incremental.PreparedStateupdateManifestForChangedInputRelinkFr...
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsprivate sourcelib.tldr.src.formats.elf.relinkclassifyTestInputsincremental.PreparedStateclassifyInputsprivate sourcelib.tldr.src.incremental.manifestclassifyTestInputsprivate sourcelib.tldr.src.incremental.manifestinitTestInputChangeStoragetest sourcelib.tldr.src.incremental.manifesttest: input change storage accepts an...+4 moreincremental.RecordedInputsfromManifest
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/tldr/src/incremental/manifest.zig:875

zig
pub const RelinkApplyError = InputChangeStorage.Exhaustion || PatchApplyError;

Source: lib/tldr/src/incremental/manifest.zig:887

zig
pub const RelinkManifestClassifyError =    InputChangeStorage.Exhaustion || RelinkManifestUpdateError;

Source: lib/tldr/src/incremental/manifest.zig:881

zig
pub const RelinkManifestUpdateError = Allocator.Error || error{    RelinkUpdateRequiresInPlacePlan,    ReplacementMissing,    MemberMissing,    SectionLayoutChanged,};

Source: lib/tldr/src/incremental/manifest.zig:876

zig
pub const ReplacementExtractError = Allocator.Error || error{    PatchRangeOutOfBounds,};
Called byCallsNo direct callsincremental.ManifestentrySymbolincremental.Stringsinternprivate sourcelib.tldr.src.incremental.manifest.StringsrebuildIdsincremental.Stringscount
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsincremental.Builderdeinitincremental.Manifestdeinitincremental.Stringsdeinit
Static calls · unresolved targets: 1 · external targets: 2.
Called byCallsNo direct callsincremental.ManifestentrySymbolincremental.Manifeststringincremental.Stringsget
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.BuilderaddArchiveMemberincremental.BuilderaddContributionWithFileSizeincremental.BuilderaddDiscardedContributionincremental.BuilderaddExternalTargetincremental.BuilderaddGotEntry+3 moreincremental.Stringscountprivate sourcelib.tldr.src.incremental.manifest.StringsrebuildIdsincremental.Stringsintern
Static calls · unresolved targets: 3 · external targets: 2.

Source: lib/tldr/src/incremental/manifest.zig:2594

zig
pub fn hashBytes(bytes: []const u8) u64 {    return std.hash.Wyhash.hash(0x544c44, bytes);}
Called byCallsNo direct callsincremental.BuilderaddInputincremental.PreparedStateupdateManifestForAcceptedChangedInput...private sourcelib.tldr.src.incremental.manifestinputContentUnchangedtest sourcelib.tldr.src.incremental.manifesttest: prepared incremental state upda...test sourcelib.tldr.src.incremental.manifesttest: prepared incremental state upda...incrementalhashBytes
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/tldr/src/incremental/manifest.zig:861

zig
pub const manifest_binary_protocol = "tldr.incremental-manifest.bin/v10";

Source: lib/tldr/src/incremental/manifest.zig:1880

zig
pub fn planRelinkFromInputChanges(input_changes: InputChanges) RelinkPlan {    return planRelinkFromInputChangesWithContributions(input_changes, &.{});}
Called byCallsNo direct callersprivate sourcelib.tldr.src.incremental.manifestplanRelinkFromInputChangesWithContrib...incrementalplanRelinkFromInputChanges
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/tldr/src/incremental/manifest.zig:1884

zig
pub fn replacementContributionsFromImage(    allocator: Allocator,    image: []const u8,    manifest: Manifest,    input_changes: InputChanges,) ReplacementExtractError![]ReplacementContribution {    if (input_changes.summary.changed == 0 or manifest.contributions.len == 0) return &.{};    if (input_changes.summary.changed <= sparse_replacement_extraction_change_limit) {        return try replacementContributionsFromImageSparse(allocator, image, manifest, input_changes);    }    const current_change_indexes = try currentChangeIndexesAlloc(allocator, input_changes);    defer if (current_change_indexes.len != 0) allocator.free(current_change_indexes);    const replacement_count = countChangedInputContributions(manifest, input_changes, current_change_indexes);    if (replacement_count == 0) return &.{};    const replacements = try allocator.alloc(ReplacementContribution, replacement_count);    errdefer allocator.free(replacements);    var replacement_index: usize = 0;    for (manifest.contributions) |contribution| {        const current_index = std.math.cast(usize, contribution.input_index) orelse continue;        const change = changeForCurrentInput(input_changes, current_change_indexes, current_index) orelse continue;        if (change.kind != .changed) continue;        const recorded_index = change.recorded_index orelse continue;        replacements[replacement_index] = .{            .input_name = manifest.string(contribution.input_name_id),            .input_index = recorded_index,            .kind = contribution.kind,            .name = manifest.string(contribution.name_id),            .ordinal = contribution.ordinal,            .size = contribution.size,            .alignment = contribution.alignment,            .output_section_name = manifest.string(contribution.output_section_name_id),            .address = contribution.address,            .file_offset = contribution.file_offset,            .reserved_size = contribution.reserved_size,            .payload = try contributionPayload(image, contribution),        };        replacement_index += 1;    }    return replacements;}
Called byCallsincremental.PreparedStateapplyChangedInputRelinkFromCandidatetest sourcelib.tldr.src.incremental.manifesttest: replacement extraction handles ...test sourcelib.tldr.src.incremental.manifesttest: replacement extraction maps cur...test sourcelib.tldr.src.incremental.manifesttest: replacement extraction rejects ...private sourcelib.tldr.src.incremental.manifestchangeForCurrentInputprivate sourcelib.tldr.src.incremental.manifestcontributionPayloadprivate sourcelib.tldr.src.incremental.manifestcountChangedInputContributionsprivate sourcelib.tldr.src.incremental.manifestcurrentChangeIndexesAllocprivate sourcelib.tldr.src.incremental.manifestreplacementContributionsFromImageSpar...incrementalreplacementContributionsFromImage
Static calls · unresolved targets: 0 · external targets: 3.
Called byCallstest sourcelib.tldr.src.incremental.manifesttest: incremental patch application w...incremental.ContributionIndexcontributionIndexForReplacementincremental.ContributionIndexplanContributionReplacementprivate sourcelib.tldr.src.incremental.patchapplyReplacementBytesincremental.ContributionIndexapplyContributionReplacement
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.patchtest: contribution index accepted in-...incremental.ContributionIndexcontributionIndexForReplacementprivate sourcelib.tldr.src.incremental.patchapplyReplacementBytesincremental.ContributionIndexapplyContributionReplacementInPlace
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsincremental.ContributionIndexapplyContributionReplacementincremental.ContributionIndexapplyContributionReplacementInPlaceincremental.ContributionIndexplanContributionReplacementprivate sourcelib.tldr.src.incremental.patch.ContributionKeyfromReplacementincremental.ContributionIndexcontributionIndexForReplacement
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callstest sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental patch application w...test sourcelib.tldr.src.incremental.manifesttest: incremental planner uses input ...test sourcelib.tldr.src.incremental.patchtest: contribution index accepted in-...incremental.ContributionIndexdeinit
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallstest sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental patch application w...test sourcelib.tldr.src.incremental.manifesttest: incremental planner uses input ...test sourcelib.tldr.src.incremental.patchtest: contribution index accepted in-...private sourcelib.tldr.src.incremental.patch.ContributionKeyfromRecordincremental.ContributionIndexinit
Static calls · unresolved targets: 0 · external targets: 3.
Called byCallsincremental.PreparedStateensureReplacementIndexprivate sourcelib.tldr.src.incremental.patch.ContributionKeyfromRecordincremental.ContributionIndexinitForReplacements
Static calls · unresolved targets: 0 · external targets: 6.
Called byCallstest sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental contribution index ...test sourcelib.tldr.src.incremental.manifesttest: incremental planner uses input ...incremental.ContributionIndexapplyContributionReplacementincremental.ContributionIndexcontributionIndexForReplacementprivate sourcelib.tldr.src.incremental.patch.ContributionKeyfromRecordprivate sourcelib.tldr.src.incremental.patch.ContributionKeyfromReplacementprivate sourcelib.tldr.src.incremental.patchblockerForRecordincremental.ContributionIndexplanContributionReplacement
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersincrementalfreeReplacementContributionsincremental.DirectRelinkEvidencedeinit
Static calls · unresolved targets: 0 · external targets: 1.

Source: lib/tldr/src/incremental/patch.zig:177

zig
pub const IndexError = Allocator.Error || DuplicateContributionError;

Source: lib/tldr/src/incremental/patch.zig:40

zig
pub fn freeReplacementContributions(allocator: Allocator, replacements: []const ReplacementContribution) void {    for (replacements) |replacement| {        if (replacement.payload_owned) allocator.free(replacement.payload);    }    if (replacements.len != 0) allocator.free(replacements);}
Called byCallsNo direct callsincremental.PreparedStateapplyChangedInputRelinkFromCandidateincremental.DirectRelinkEvidencedeinitincrementalfreeReplacementContributions
Static calls · unresolved targets: 0 · external targets: 1.

Source: lib/tldr/src/incremental/root.zig

zig
const manifest = @import("manifest.zig");const patch_module = @import("patch.zig");const format_module = @import("format.zig");pub const StringSpan = manifest.StringSpan;pub const Strings = manifest.Strings;pub const RecordOwnership = manifest.RecordOwnership;pub const InputRecord = manifest.InputRecord;pub const SectionRecord = manifest.SectionRecord;pub const ContributionKind = manifest.ContributionKind;pub const ContributionRecord = manifest.ContributionRecord;pub const DiscardReason = manifest.DiscardReason;pub const DiscardedContributionRecord = manifest.DiscardedContributionRecord;pub const ExternalTargetRecord = manifest.ExternalTargetRecord;pub const ArchiveMemberRecord = manifest.ArchiveMemberRecord;pub const GotEntryRecord = manifest.GotEntryRecord;pub const MergePieceRecord = manifest.MergePieceRecord;pub const InputChangeKind = manifest.InputChangeKind;pub const InputChange = manifest.InputChange;pub const InputChangeSummary = manifest.InputChangeSummary;pub const InputContributionSummary = manifest.InputContributionSummary;pub const InputChanges = manifest.InputChanges;pub const RecordedInputs = manifest.RecordedInputs;pub const InputChangeStorage = manifest.InputChangeStorage;pub const RelinkDecision = manifest.RelinkDecision;pub const RelinkBlocker = manifest.RelinkBlocker;pub const RelinkPlan = manifest.RelinkPlan;pub const manifest_binary_protocol = manifest.manifest_binary_protocol;pub const ReplacementContribution = manifest.ReplacementContribution;pub const DirectRelinkEvidence = manifest.DirectRelinkEvidence;pub const MemberHashUpdate = manifest.MemberHashUpdate;pub const PatchDecision = manifest.PatchDecision;pub const PatchBlocker = manifest.PatchBlocker;pub const PatchPlan = manifest.PatchPlan;pub const PatchApplication = manifest.PatchApplication;pub const FileRange = patch_module.FileRange;pub const ManifestFieldPatch = format_module.ManifestFieldPatch;pub const PatchApplyError = manifest.PatchApplyError;pub const IndexError = manifest.IndexError;pub const ContributionIndex = manifest.ContributionIndex;pub const RelinkApplyError = manifest.RelinkApplyError;pub const ReplacementExtractError = manifest.ReplacementExtractError;pub const CandidateRelinkApplyError = manifest.CandidateRelinkApplyError;pub const RelinkManifestUpdateError = manifest.RelinkManifestUpdateError;pub const RelinkManifestClassifyError = manifest.RelinkManifestClassifyError;pub const RelinkApplication = manifest.RelinkApplication;pub const Manifest = manifest.Manifest;pub const PreparedState = manifest.PreparedState;pub const planRelinkFromInputChanges = manifest.planRelinkFromInputChanges;pub const replacementContributionsFromImage = manifest.replacementContributionsFromImage;pub const freeReplacementContributions = manifest.freeReplacementContributions;pub const Builder = manifest.Builder;pub const hashBytes = manifest.hashBytes;

Source: lib/tldr/src/root.zig:58

zig
pub const incremental = @import("incremental/root.zig");

Complete caller list for incremental.Builder.addContribution

42 direct callers.

Complete caller list for incremental.Builder.addInput

44 direct callers.

Complete caller list for incremental.Builder.addSection

7 direct callers.

Complete caller list for incremental.Builder.deinit

58 direct callers.

Complete caller list for incremental.Builder.finish

58 direct callers.

Complete caller list for incremental.Builder.init

58 direct callers.

Complete caller list for incremental.PreparedState.fromOwnedManifest

36 direct callers.

Complete call list for incremental.PreparedState.updateManifestForAcceptedCandidateRelinkFromInputChanges

9 direct calls.

Complete caller list for incremental.RecordedInputs.fromManifest

9 direct callers.

Complete caller list for incremental.Strings.intern

8 direct callers.

Audit

Definitions137
Public names137
Members222
Version26.7.0
Revisiondaab053ee433