perf(fix): implement dynamic Config arrays (missed from wave2)
The dynamic Config array conversion (Todo 2.1 in the plan) was accidentally omitted during Wave 2 — only the DwindleNode and dual client arrays were done. This commit implements the missing work: - Convert Config keybinds/buttons/scrolls from fixed-size arrays (keybinds[128]) to pointer+count+cap (keybinds, nkeybinds, keybinds_cap) - config_load allocates with ecalloc(16) for each array, doubles on overflow - on_config_reload and do_reload use deep-copy protocol: free old arrays → *newcfg → zero source pointers - sizeof(Config): ~250 KB → ~28 KB (latest measurement) - Zero-warning build
This commit is contained in:
+6
-3
@@ -143,14 +143,17 @@ typedef struct {
|
||||
CfgMonitorRule monitors[CFG_MAX_MONITORS];
|
||||
int nmonitors;
|
||||
|
||||
CfgKeybind keybinds[CFG_MAX_KEYBINDS];
|
||||
CfgKeybind *keybinds;
|
||||
int nkeybinds;
|
||||
int keybinds_cap;
|
||||
|
||||
CfgButton buttons[CFG_MAX_KEYBINDS];
|
||||
CfgButton *buttons;
|
||||
int nbuttons;
|
||||
int buttons_cap;
|
||||
|
||||
CfgScroll scrolls[CFG_MAX_KEYBINDS];
|
||||
CfgScroll *scrolls;
|
||||
int nscrolls;
|
||||
int scrolls_cap;
|
||||
|
||||
bool sloppyfocus;
|
||||
bool bypass_surface_visibility;
|
||||
|
||||
Reference in New Issue
Block a user