mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Expand lines more aggressively to reduce rate of allocations.
This commit is contained in:
		
							
								
								
									
										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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user