summaryrefslogtreecommitdiff
path: root/core/fs.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/fs.zig')
-rw-r--r--core/fs.zig10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/fs.zig b/core/fs.zig
index a64487d6..6b43ba67 100644
--- a/core/fs.zig
+++ b/core/fs.zig
@@ -884,8 +884,10 @@ pub const Namespace = struct {
os_paths: std.ArrayList(OsPath) = .empty,
/// What each open holds between its open and its release.
opens: [tree.open_slots]tree.Open = @splat(.{}),
- /// The records past it are free: a digest and a dump take the opens
- /// this far (an idle session's none).
+ /// The records past it are nothing: a digest, a dump and a replica's
+ /// rollback copy take the opens this far (an idle session's none), and
+ /// nothing reads or frees one past it (a rollback leaves there what
+ /// its epoch freed).
opens_len: u8 = 0,
out: std.ArrayList(u8) = .empty,
listeners: u16 = 0,
@@ -1024,7 +1026,7 @@ pub const Namespace = struct {
st.mounts.deinit(gpa);
for (st.os_paths.items) |entry| gpa.free(entry.path);
st.os_paths.deinit(gpa);
- for (&st.opens) |*o| o.deinit(gpa);
+ for (st.opens[0..st.opens_len]) |*o| o.deinit(gpa);
for (st.pages.items) |*page| page.bytes.deinit(gpa);
st.pages.deinit(gpa);
for (st.closed_lines.items) |*line| line.bytes.deinit(gpa);
@@ -1057,7 +1059,7 @@ pub const Namespace = struct {
/// What the requests of connections gone made, let go: a session
/// revived from a dump has none of the connections that held its opens.
pub fn forget(st: *Namespace, gpa: std.mem.Allocator) void {
- for (&st.opens) |*o| o.deinit(gpa);
+ for (st.opens[0..st.opens_len]) |*o| o.deinit(gpa);
st.opens_len = 0;
st.results_len = 0;
st.batch.bytes.deinit(gpa);