mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
terminal: page size should be accounted every creation
This commit is contained in:
@ -1387,8 +1387,8 @@ pub fn grow(self: *PageList) !?*List.Node {
|
|||||||
self.pages.append(next_page);
|
self.pages.append(next_page);
|
||||||
next_page.data.size.rows = 1;
|
next_page.data.size.rows = 1;
|
||||||
|
|
||||||
// Accounting
|
// We should never be more than our max size here because we've
|
||||||
self.page_size += PagePool.item_size;
|
// verified the case above.
|
||||||
assert(self.page_size <= self.max_size);
|
assert(self.page_size <= self.max_size);
|
||||||
|
|
||||||
return next_page;
|
return next_page;
|
||||||
@ -1412,6 +1412,11 @@ fn createPage(self: *PageList, cap: Capacity) !*List.Node {
|
|||||||
};
|
};
|
||||||
page.data.size.rows = 0;
|
page.data.size.rows = 0;
|
||||||
|
|
||||||
|
// Accumulate page size now. We don't assert or check max size because
|
||||||
|
// we may exceed it here temporarily as we are allocating pages before
|
||||||
|
// destroy.
|
||||||
|
self.page_size += PagePool.item_size;
|
||||||
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -635,7 +635,7 @@ pub const ImageStorage = struct {
|
|||||||
// Our pin for the placement
|
// Our pin for the placement
|
||||||
fn trackPin(
|
fn trackPin(
|
||||||
t: *terminal.Terminal,
|
t: *terminal.Terminal,
|
||||||
pt: point.Point.Coordinate,
|
pt: point.Coordinate,
|
||||||
) !*PageList.Pin {
|
) !*PageList.Pin {
|
||||||
return try t.screen.pages.trackPin(t.screen.pages.pin(.{
|
return try t.screen.pages.trackPin(t.screen.pages.pin(.{
|
||||||
.active = pt,
|
.active = pt,
|
||||||
|
Reference in New Issue
Block a user