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
23 lines
615 B
C
23 lines
615 B
C
#pragma once
|
|
|
|
#include "monitor.h"
|
|
#include "client.h"
|
|
|
|
extern const Layout layouts[];
|
|
extern const unsigned int layout_count;
|
|
|
|
void dwindle(Monitor *m);
|
|
void master(Monitor *m);
|
|
void monocle(Monitor *m);
|
|
|
|
[[nodiscard]] int current_tag_idx(Monitor *m);
|
|
[[nodiscard]] const Layout *curlayout(Monitor *m);
|
|
void ensure_cold(Monitor *m);
|
|
|
|
[[nodiscard]] int dwindle_find_leaf(const DwindleTree *tree, Client *c);
|
|
void dwindle_recalc(DwindleTree *tree, int gap);
|
|
void dwindle_free_tree(DwindleTree *tree);
|
|
void dwindle_remove_client(Client *c);
|
|
void master_remove_client(Client *c);
|
|
void swaptiled(Client *a, Client *b);
|