mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
terminal: do not run page integrity checks unless slow runtime safety
This commit is contained in:
@ -319,11 +319,13 @@ pub const Page = struct {
|
|||||||
/// when runtime safety is enabled. This is a no-op when runtime
|
/// when runtime safety is enabled. This is a no-op when runtime
|
||||||
/// safety is disabled. This uses the libc allocator.
|
/// safety is disabled. This uses the libc allocator.
|
||||||
pub fn assertIntegrity(self: *const Page) void {
|
pub fn assertIntegrity(self: *const Page) void {
|
||||||
|
if (comptime build_config.slow_runtime_safety) {
|
||||||
self.verifyIntegrity(std.heap.c_allocator) catch |err| {
|
self.verifyIntegrity(std.heap.c_allocator) catch |err| {
|
||||||
log.err("page integrity violation, crashing. err={}", .{err});
|
log.err("page integrity violation, crashing. err={}", .{err});
|
||||||
@panic("page integrity violation");
|
@panic("page integrity violation");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Verifies the integrity of the page data. This is not fast,
|
/// Verifies the integrity of the page data. This is not fast,
|
||||||
/// but it is useful for assertions, deserialization, etc. The
|
/// but it is useful for assertions, deserialization, etc. The
|
||||||
|
Reference in New Issue
Block a user