summaryrefslogtreecommitdiff
path: root/src/File.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 00:12:46 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:00:59 -0300
commitb283824eed0703ae9b89f2af520354046146b855 (patch)
treea791b93be7849d4ab5a804cf9e9118eba406474b /src/File.zig
parent2f2fd5f6cf52800f931fd62e539c2b4ed5d80ebc (diff)
downloadpardes-b283824eed0703ae9b89f2af520354046146b855.tar.gz
pardes-b283824eed0703ae9b89f2af520354046146b855.zip
memory: freeUnfilled, freeRaw for a slice of u8 written out again, goes; its callers (File.zig's three, walk.zig's, memory.zig's tests) call freeRaw, and walk.zig's comments name it alone
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/File.zig')
-rw-r--r--src/File.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/File.zig b/src/File.zig
index 7acf8dd6..1199e2fb 100644
--- a/src/File.zig
+++ b/src/File.zig
@@ -46,7 +46,7 @@ pub const Snapshot = struct {
saved_len: ?usize = null,
fn deinit(s: Snapshot, gpa: std.mem.Allocator) void {
- pardes.memory.freeUnfilled(gpa, s.content);
+ pardes.memory.freeRaw(gpa, s.content);
}
};
@@ -818,7 +818,7 @@ pub fn deinit(p: *Pardes, pane: *Pane, file: *State) void {
p.gpa.free(file.path);
// Raw, as every text is freed (a replica's rollback copy pins them,
// src/rollback.zig, and a safe build's free writes over what it frees).
- if (ntwins == 0) pardes.memory.freeUnfilled(p.gpa, file.content);
+ if (ntwins == 0) pardes.memory.freeRaw(p.gpa, file.content);
if (file.listing) |listing| p.gpa.free(listing.names);
if (file.mini) |*mini| mini.deinit(p.gpa);
if (file.line_starts.len > 0 and !index_shared) pardes.memory.freeRaw(p.gpa, file.line_starts);
@@ -915,7 +915,7 @@ pub fn setContentSpan(p: *Pardes, f: *State, new: []u8, span_in: ?Span) void {
}
// Raw: `free` overwrites a safe build's freed memory, a whole file's
// worth per keystroke; and its digest word goes (src/walk.zig).
- pardes.memory.freeUnfilled(p.gpa, f.content);
+ pardes.memory.freeRaw(p.gpa, f.content);
f.content = new;
f.revision +%= 1;
f.splice = .{ .revision = f.revision, .head = known.head, .tail = known.tail, .old_len = old_len };