perf(wave2): dynamic config arrays, flat dwindle tree, dual client arrays

Wave 2 changes:
- Dynamic Config arrays with geometric growth (cap=16, 2x growth)
  → saves ~2.5 MB heap for typical configs vs fixed 128-entry arrays
- Proper deep-copy protocol in on_config_reload/do_reload (free old, move new, zero source)
- Flat DwindleTree array with int children[2]/parent indices
  → eliminates pointer chasing, contiguous allocation, iterative two-pass recalc
- Lazy per-tag allocation (DwindleTree.nodes starts NULL, allocates on first use)
- Dual client_arr + fstack_arr arrays alongside wl_list/fstack for cache-friendly iteration
  → arrange() and focustop() use array scan instead of linked-list pointer chase
- All arrays maintain size-tracking (nclients, nfstack) for bounds checking
- Zero-warning build with clang -Werror -Wpedantic
This commit is contained in:
2026-07-02 23:50:43 -04:00
parent fb0f49e861
commit 7f3cad8cb6
6 changed files with 323 additions and 275 deletions
+5
View File
@@ -30,6 +30,11 @@ typedef union {
#define MAX(A, B) ((A) > (B) ? (A) : (B))
#define MIN(A, B) ((A) < (B) ? (A) : (B))
extern struct Client **client_arr;
extern int nclients;
extern struct Client **fstack_arr;
extern int nfstack;
/* Convenience wrapper for the function below */
#define VISIBLEON(C, M) visibleon((C), (M))