config: avoid tll() code expansion when generating default bindings

tll_push_back() is a macro that results in quite a lot of
instructions. Expanding this macro explicitly in many places thus
causes code explosion.

This is what happened in when we generate the default key/mouse
bindings.

Fix by calling tll_push_back() in a no-inline function.

Reduces code size with ~4-5K
This commit is contained in:
Daniel Eklöf 2021-05-07 17:18:46 +02:00
parent 449ac7c361
commit ba2c3606bf
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 34 additions and 29 deletions

View file

@ -52,6 +52,7 @@ struct config_mouse_binding {
int count;
struct config_binding_pipe pipe;
};
typedef tll(struct config_mouse_binding) config_mouse_binding_list_t;
struct config_spawn_template {
char *raw_cmd;
@ -166,7 +167,7 @@ struct config {
struct {
/* Bindings for "normal" mode */
config_key_binding_list_t key;
tll(struct config_mouse_binding) mouse;
config_mouse_binding_list_t mouse;
/*
* Special modes