diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-23 02:23:34 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-23 02:23:34 -0300 |
| commit | 1ebae0db0a185455b2a03f22f5106113c6407a2f (patch) | |
| tree | db0e473c2c060e6bf7d4f4d169ffff11178056c3 /core/edit.zig | |
| parent | 5393ce743d7848d26e60fd7d4d27a4119272df9f (diff) | |
| parent | de0e85daa8ad0bf9618734e16568823aa2b61a54 (diff) | |
| download | pardes-1ebae0db0a185455b2a03f22f5106113c6407a2f.tar.gz pardes-1ebae0db0a185455b2a03f22f5106113c6407a2f.zip | |
integration (a base for the next rounds, not yet the gathered line): the one decision on the tree to install: pardes-merge60 (`krovvoum`: the viewport, a client's way back at an Upgrade, the pair's round 12, the lanes on the glide; in its whole gate) and pardes-one-decision (`ltvyvwru` on `wllwukuk` on `trmpwtso`, on pardes-viewport: one count of an emulator's writes in the core (`Pardes.outside`), copied, digested and dumped, which `Replica.confirm` reads once a unit where four spread checks stood; the rollback copy walks every type unless it declares `outside_copy`: the Changes layer's heap was not walked and was freed twice); no conflict; core-test 919/1083 (164 skipped), shell-test 1125/1128 (2026-11-23)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/edit.zig')
| -rw-r--r-- | core/edit.zig | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/edit.zig b/core/edit.zig index f3a87e57..70b765cc 100644 --- a/core/edit.zig +++ b/core/edit.zig @@ -427,8 +427,13 @@ pub var drawing = false; /// A terminal's rows as text (`Term.rows`), kept for one pane until its /// grid moves. Returned slices remain valid until the next cache rebuild -/// or reset. +/// or reset. A replica's rollback copy holds it as any state: its text and +/// rows are made whole and freed whole, never written, so the copy pins +/// them (blobs, freed raw) and puts the cache back with the core: no +/// emulator is written while a copy is held (replica.zig `confirm`: a unit +/// that writes one lets the copy go or is applied after it is put back). pub const RowsCache = struct { + pub const replica = .{ .blob = .{ "text", "rows", "text_alloc" } }; /// whose grid this describes; null = the slot is free pane: ?*const Pane = null, /// the rows joined by '\n' — `flatSurface` hands this back verbatim @@ -442,8 +447,8 @@ pub const RowsCache = struct { stale: bool = false, pub fn reset(c: *RowsCache, gpa: std.mem.Allocator) void { - if (c.text_alloc.len > 0) gpa.free(c.text_alloc); - if (c.rows.len > 0) gpa.free(c.rows); + pardes.memory.freeRaw(gpa, c.text_alloc); + pardes.memory.freeRaw(gpa, c.rows); c.* = .{}; } @@ -470,7 +475,6 @@ const empty_grid = [1][]const u8{""}; /// in `Pardes.shell_rows` while its grid holds still. pub fn shellRows(p: *Pardes, pane: *Pane) ![]const []const u8 { const state = pane.terminal orelse return &empty_grid; - pardes.tape.touchTerminal(); const c = &p.shell_rows; if (!c.stale and c.pane == pane) return c.rows; // Another pane's rows, or a dropped pane's still waiting for the step's |
