diff options
| author | 2026-04-03 21:45:17 +0100 | |
|---|---|---|
| committer | 2026-04-04 01:37:54 +0100 | |
| commit | 2ee93c3f46f8e948d2331eab46c95322a88874ee (patch) | |
| tree | b3a39f8e79ef725579b569748ac4be28b82b1266 /src/con_.S | |
| parent | e174011b5e7390dc8714910185aaa40d0a44702f (diff) | |
| download | sst-2ee93c3f46f8e948d2331eab46c95322a88874ee.tar.gz sst-2ee93c3f46f8e948d2331eab46c95322a88874ee.zip | |
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.
Diffstat (limited to 'src/con_.S')
| -rw-r--r-- | src/con_.S | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -42,4 +42,24 @@ ASM_MANGLE(_con_colourmsg): .byte 0x25 .long ASM_MANGLE(_con_colourmsgf) +// The DEF_CVAR macros put stuff in .rdata$y/.rodata.cvars1. Sandwiching that +// between empty x/0 and z/2 sections gives us section start/end pointers to +// iterate the cvars, which is used for freeing the values on unload. Relies +// on the section merging not adding extra padding, which is fine with the +// linker + settings we use in practice. +#ifdef _WIN32 +.section .rdata$x, "rw" +#else +.section .rodata.cvars0, "rw" +#endif +.globl ASM_MANGLE(_con_vars_start) +ASM_MANGLE(_con_vars_start): +#ifdef _WIN32 +.section .rdata$z, "rw" +#else +.section .rodata.cvars2, "rw" +#endif +.globl ASM_MANGLE(_con_vars_end) +ASM_MANGLE(_con_vars_end): + // vi: sw=4 ts=4 noet tw=80 cc=80 |
