diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 16:57:01 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 68e30f560e46bb9a30433eb23b4edb1b93d69f46 (patch) | |
| tree | 3f5f3085051488635ec61c02e33062e1eb94bdd7 /src/Terminal.zig | |
| parent | cd563b1768c688444cc6d172b3679d95b495207c (diff) | |
| download | pardes-68e30f560e46bb9a30433eb23b4edb1b93d69f46.tar.gz pardes-68e30f560e46bb9a30433eb23b4edb1b93d69f46.zip | |
A selection's other ranges live out of line, made at the second range and freed at one
The ranges beside the primary were an inline array in every Text, which at
1024 grew each pane by about 60 KiB. They are now allocated when a second
range appears (Text.reserveSels) and given back when the selection is one
range again (Text.dropSels); a column's or the workspace's tag allocates from
Text.gpa, any other text from its pane's. A refused tag edit restores them by
copy. The Pane size budget is back to 128 KiB, and a test holds that a single
cursor allocates nothing for them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/Terminal.zig')
| -rw-r--r-- | src/Terminal.zig | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Terminal.zig b/src/Terminal.zig index 4c29e151..ba156ada 100644 --- a/src/Terminal.zig +++ b/src/Terminal.zig @@ -545,10 +545,7 @@ test "replay ownership is terminal-only and construction rolls back on allocatio try std.testing.expectEqual(terminal and enabled, pane.terminal != null); } }; - // Most of it is the three texts' selections, limits.selections ranges - // each held inline (about 20 KiB a text on the desktop), and the regex - // prompt's snapshot of them. - try std.testing.expect(@sizeOf(Pane) < 160 * 1024); + try std.testing.expect(@sizeOf(Pane) < 128 * 1024); try std.testing.checkAllAllocationFailures(std.testing.allocator, Case.run, .{false}); try std.testing.checkAllAllocationFailures(std.testing.allocator, Case.run, .{true}); } |
