diff options
Diffstat (limited to 'src/limits.zig')
| -rw-r--r-- | src/limits.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/limits.zig b/src/limits.zig index 965f4d0a..75bf5262 100644 --- a/src/limits.zig +++ b/src/limits.zig @@ -77,6 +77,21 @@ pub const board_heap_bytes = 384 * KiB; /// `emitWrite`, i.e. only if a pty ever appears on this platform. pub const effect_cap = if (board) 128 else 4096; +/// Bytes of a pane's pty write that may WAIT in the core when `effect_cap` +/// chunks are already queued. `emitWrite` splits a burst into fixed 64-byte +/// effects, so without this a paste larger than `effect_cap * 64` (256 KiB on +/// a desktop) lost its tail silently — the ring refuses rather than evicts, +/// which keeps queued bytes in order but cut the new ones off. The remainder +/// parks here instead and `nextEffect` refills the ring as the host drains it, +/// so a large paste is DELAYED rather than truncated. +/// +/// 4 MiB matches `tty.max_paste_bytes`, the largest burst a host can hand the +/// core in one event, so the bound is the one the producer already enforces. +/// Zero on the board: no ptys means no `emitWrite`, and the allocation this +/// would justify cannot live in 384 KiB anyway. A zero cap parks nothing and +/// restores the old refusal exactly. +pub const pending_write_cap: usize = if (board) 0 else 4 << 20; + /// Rows the per-pane soft-wrap map covers. `wrapWidth` refuses to wrap a pane /// taller than this (it reads the array's own length), so shrinking it cannot /// truncate a map — a taller pane renders unwrapped, exactly as documented on |
