summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-02-22 07:09:07 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-02-22 07:09:07 +0000
commitb9dba9d4c945300dc2fdfb409cf88d94d2030dfd (patch)
tree0b89ec4f1d703dfed5c6a470fb1ee322003ba5ae /usr.bin/tmux/window.c
parent2673ef2b4e8986b15b7e966be74ce8c108ef3e01 (diff)
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.
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r--usr.bin/tmux/window.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index 3082d1b7c1d..0633425979c 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.268 2021/01/20 07:16:54 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.269 2021/02/22 07:09:06 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -63,17 +63,6 @@ static u_int next_window_pane_id;
static u_int next_window_id;
static u_int next_active_point;
-/* List of window modes. */
-const struct window_mode *all_window_modes[] = {
- &window_buffer_mode,
- &window_client_mode,
- &window_clock_mode,
- &window_copy_mode,
- &window_tree_mode,
- &window_view_mode,
- NULL
-};
-
struct window_pane_input_data {
struct cmdq_item *item;
u_int wp;