summaryrefslogtreecommitdiff
path: root/src/walk.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/walk.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/walk.zig')
-rw-r--r--src/walk.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/walk.zig b/src/walk.zig
index 601b1387..53d4b82c 100644
--- a/src/walk.zig
+++ b/src/walk.zig
@@ -24,7 +24,7 @@
//! // What a field holds is made with another allocator on a load.
//! .alloc = .{ .{ "image", "image" } },
//! // Immutable blobs: replaced whole, never written, freed raw
-//! // (memory.freeRaw, freeUnfilled). A digest hashes each once and
+//! // (memory.freeRaw). A digest hashes each once and
//! // folds that word in; a replica's rollback copy pins them.
//! .blob = .{ "content" },
//! };
@@ -55,7 +55,7 @@ pub fn blob(comptime T: type, comptime name: []const u8) bool {
// unit a replica replays): a 100 MB file was hashed in full each time. A
// blob of `blob_min` bytes or more is hashed once instead, its word kept by
// its address, and the digest folds the word in. The word goes when the
-// blob is freed (`forget`, from memory.freeRaw and freeUnfilled: every
+// blob is freed (`forget`, from memory.freeRaw: every
// such blob is freed raw, for the rollback copy's pins), so an address
// used again is hashed again. A Debug build hashes the bytes all the same,
// folds those in, and stops where a kept word is not their hash: a blob
@@ -1904,6 +1904,6 @@ test "a blob is hashed once and folded in as a word; one written in place is not
text[1000] = 'a';
try std.testing.expectEqual(digestOfBlob(text), wordOf(@intFromPtr(text.ptr)).?);
// Freed, its word goes: an address used again is hashed again.
- memory.freeUnfilled(gpa, text);
+ memory.freeRaw(gpa, text);
try std.testing.expect(wordOf(@intFromPtr(text.ptr)) == null);
}