mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Expand lines more aggressively to reduce rate of allocations.
This commit is contained in:
parent
7d23d019c0
commit
75adf8368a
6
grid.c
6
grid.c
@ -292,6 +292,12 @@ grid_expand_line(struct grid *gd, u_int py, u_int sx, u_int bg)
|
||||
if (sx <= gl->cellsize)
|
||||
return;
|
||||
|
||||
if (sx < gd->sx) {
|
||||
sx *= 2;
|
||||
if (sx > gd->sx)
|
||||
sx = gd->sx;
|
||||
}
|
||||
|
||||
gl->celldata = xreallocarray(gl->celldata, sx, sizeof *gl->celldata);
|
||||
for (xx = gl->cellsize; xx < sx; xx++)
|
||||
grid_clear_cell(gd, xx, py, bg);
|
||||
|
Loading…
Reference in New Issue
Block a user