diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-10 21:51:57 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-10 21:51:57 +0300 |
| commit | 425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch) | |
| tree | e52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/src/terminal/compress | |
| parent | 90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff) | |
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/terminal/compress')
| -rw-r--r-- | vendor/libghostty-vt/src/terminal/compress/Page.zig | 14 | ||||
| -rw-r--r-- | vendor/libghostty-vt/src/terminal/compress/lz4_differential.zig | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/vendor/libghostty-vt/src/terminal/compress/Page.zig b/vendor/libghostty-vt/src/terminal/compress/Page.zig index b7ad8025..8eb9caab 100644 --- a/vendor/libghostty-vt/src/terminal/compress/Page.zig +++ b/vendor/libghostty-vt/src/terminal/compress/Page.zig @@ -106,6 +106,15 @@ pub fn init( if (scratch.len < required) return error.OutputTooSmall; if (required == 0) return null; + // Page memory is an opaque snapshot containing structs whose padding has + // no semantic value. Assigning those structs can leave their padding + // undefined in Memcheck even though every byte is addressable and must be + // preserved by compression. Mark the complete byte representation as + // defined at this boundary so that undefined padding does not propagate + // through the codec and obscure real Valgrind failures. + if (std.valgrind.runningOnValgrind() > 0) + std.valgrind.memcheck.makeMemDefined(source.memory); + const encoded_len = lz4.compress( source.memory, scratch[0..required], @@ -209,6 +218,11 @@ test "compressed Page retained mapping round trip" { const expected = try testing.allocator.dupe(u8, resident.memory); defer testing.allocator.free(expected); + if (std.valgrind.runningOnValgrind() > 0) { + // This snapshot deliberately includes semantically irrelevant struct + // padding so the round trip can compare the complete representation. + std.valgrind.memcheck.makeMemDefined(expected); + } const memory_ptr = resident.memory.ptr; const memory_len = resident.memory.len; diff --git a/vendor/libghostty-vt/src/terminal/compress/lz4_differential.zig b/vendor/libghostty-vt/src/terminal/compress/lz4_differential.zig index bbf3b276..f164ec04 100644 --- a/vendor/libghostty-vt/src/terminal/compress/lz4_differential.zig +++ b/vendor/libghostty-vt/src/terminal/compress/lz4_differential.zig @@ -485,7 +485,7 @@ test "lz4 differential light" { test "lz4 differential exhaustive" { // Slow. Enable explicitly, ideally together with a test filter: // GHOSTTY_LZ4_SLOW=1 zig build test -Dtest-filter="lz4 differential" - if (!std.process.hasEnvVarConstant("GHOSTTY_LZ4_SLOW")) + if (!std.testing.environ.containsConstant("GHOSTTY_LZ4_SLOW")) return error.SkipZigTest; // Several independent seeds; the suite is deterministic per seed. |
