aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/terminal/compress/Page.zig
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-10 21:51:57 +0300
committerGitHub <noreply@github.com>2026-09-10 21:51:57 +0300
commit425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch)
treee52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/src/terminal/compress/Page.zig
parent90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff)
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/terminal/compress/Page.zig')
-rw-r--r--vendor/libghostty-vt/src/terminal/compress/Page.zig14
1 files changed, 14 insertions, 0 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;