mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	There are many format variables now so allocating all the default ones
each time a tree is created is too expensive. Instead, convert them all into callbacks and put them in a static table so they only allocate on demand. The tree remains for the moment for extra (non-default) variables added by for example copy mode or popups. Also reduce expensive calls to localtime_r/strftime. GitHub issue 2253.
This commit is contained in:
		@@ -710,7 +710,7 @@ window_copy_get_line(struct window_pane *wp, u_int y)
 | 
			
		||||
	return (format_grid_line(gd, gd->hsize + y));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char *
 | 
			
		||||
static void *
 | 
			
		||||
window_copy_cursor_word_cb(struct format_tree *ft)
 | 
			
		||||
{
 | 
			
		||||
	struct window_pane		*wp = format_get_pane(ft);
 | 
			
		||||
@@ -720,7 +720,7 @@ window_copy_cursor_word_cb(struct format_tree *ft)
 | 
			
		||||
	return (window_copy_get_word(wp, data->cx, data->cy));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char *
 | 
			
		||||
static void *
 | 
			
		||||
window_copy_cursor_line_cb(struct format_tree *ft)
 | 
			
		||||
{
 | 
			
		||||
	struct window_pane		*wp = format_get_pane(ft);
 | 
			
		||||
@@ -730,7 +730,7 @@ window_copy_cursor_line_cb(struct format_tree *ft)
 | 
			
		||||
	return (window_copy_get_line(wp, data->cy));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char *
 | 
			
		||||
static void *
 | 
			
		||||
window_copy_search_match_cb(struct format_tree *ft)
 | 
			
		||||
{
 | 
			
		||||
	struct window_pane		*wp = format_get_pane(ft);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user