mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
terminal: relax grapheme integrity check for fast paths
This commit is contained in:
@ -56,7 +56,7 @@ pub const Attribute = sgr.Attribute;
|
|||||||
test {
|
test {
|
||||||
@import("std").testing.refAllDecls(@This());
|
@import("std").testing.refAllDecls(@This());
|
||||||
|
|
||||||
// todo: make top-level imports
|
// Internals
|
||||||
_ = @import("bitmap_allocator.zig");
|
_ = @import("bitmap_allocator.zig");
|
||||||
_ = @import("hash_map.zig");
|
_ = @import("hash_map.zig");
|
||||||
_ = @import("size.zig");
|
_ = @import("size.zig");
|
||||||
|
@ -207,6 +207,8 @@ pub const Page = struct {
|
|||||||
// trim rows without clearing data.
|
// trim rows without clearing data.
|
||||||
// - We do not check that styles seen is exactly the same as the
|
// - We do not check that styles seen is exactly the same as the
|
||||||
// styles count in the page for the same reason as above.
|
// styles count in the page for the same reason as above.
|
||||||
|
// - We only check that we saw less graphemes than the total memory
|
||||||
|
// used for the same reason as styles above.
|
||||||
//
|
//
|
||||||
|
|
||||||
var arena = ArenaAllocator.init(alloc_gpa);
|
var arena = ArenaAllocator.init(alloc_gpa);
|
||||||
@ -279,7 +281,7 @@ pub const Page = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Our graphemes seen should exactly match the grapheme count
|
// Our graphemes seen should exactly match the grapheme count
|
||||||
if (graphemes_seen != self.graphemeCount()) {
|
if (graphemes_seen > self.graphemeCount()) {
|
||||||
log.warn(
|
log.warn(
|
||||||
"page integrity violation grapheme count mismatch expected={} actual={}",
|
"page integrity violation grapheme count mismatch expected={} actual={}",
|
||||||
.{ graphemes_seen, self.graphemeCount() },
|
.{ graphemes_seen, self.graphemeCount() },
|
||||||
|
@ -232,7 +232,6 @@ pub const Set = struct {
|
|||||||
|
|
||||||
/// No more available IDs. Perform a garbage collection
|
/// No more available IDs. Perform a garbage collection
|
||||||
/// operation to compact ID space.
|
/// operation to compact ID space.
|
||||||
/// TODO: implement gc operation
|
|
||||||
Overflow,
|
Overflow,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user