From 2ee93c3f46f8e948d2331eab46c95322a88874ee Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 3 Apr 2026 21:45:17 +0100 Subject: Size-optimise cvar value cleanup Put all the cvars together contiguously; then we don't need to generate lots of individual calls to extfree() and can instead simply iterate a fixed-sized array. --- src/con_.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/con_.h') diff --git a/src/con_.h b/src/con_.h index 5de5608..9202176 100644 --- a/src/con_.h +++ b/src/con_.h @@ -273,7 +273,14 @@ extern struct _con_vtab_iconvar_wrap { } _con_vtab_iconvar_wrap; #define _con_vtab_iconvar _con_vtab_iconvar_wrap.vtable +#ifdef _WIN32 +#define _CON_VAR_SEG ".rdata$y" +#else +#define _CON_VAR_SEG ".rodata.cvars1" +#endif + #define _DEF_CVAR(name_, desc, value, hasmin_, min, hasmax_, max, flags_) \ + __attribute__((section(_CON_VAR_SEG))) \ static struct con_var _cvar_##name_ = { \ .base = { \ .vtable = _con_vtab_var, \ -- cgit v1.2.3-54-g00ecf