diff options
Diffstat (limited to 'src/tape.zig')
| -rw-r--r-- | src/tape.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tape.zig b/src/tape.zig index 7b7c02f2..3975681e 100644 --- a/src/tape.zig +++ b/src/tape.zig @@ -219,6 +219,9 @@ pub const Tape = struct { /// What stopped it: a host function's or a site's name, or a poison's /// reason (PARDES_REPLICA_STATS counts them). poisoned_by: []const u8 = "", + /// It read a terminal (its rows) or moved one's view: what it did + /// depends on the emulator, which deltas write (`touchTerminal`). + touched: bool = false, /// The allocator of the core a replay makes (a replica's rollback epoch, /// src/rollback.zig), when it is not the tape's own. core_gpa: ?std.mem.Allocator = null, @@ -1009,6 +1012,13 @@ pub fn poison(why: []const u8) void { }; } +/// A speculation read a terminal's rows or moved its view (`Tape.touched`). +pub fn touchTerminal() void { + if (on) |t| if (t.speculating) { + t.touched = true; + }; +} + /// A harmless stand-in for what a host call or a syscall would have /// returned to a speculation that is thrown away once it returns: an /// error where one can be said, else zeroes. @@ -1105,6 +1115,7 @@ pub fn beginSpeculation(t: *Tape) void { t.speculating = true; t.poisoned = false; t.poisoned_by = ""; + t.touched = false; t.no_digest = true; t.buf.clearRetainingCapacity(); t.seeFields(); |
