TsundereStation/src
Lib 66ee835d3f core: mark TU-local globals static
Three file-scope variables had external linkage by accident:

- bus.cpp m_ram_code_page_count (set in 2 places, read from a hot
  loop in a 3rd). Mirror file declares m_ram_code_bits as extern
  for cross-TU use by cpu_code_cache, but m_ram_code_page_count
  has no header counterpart and zero references outside bus.cpp.

- cpu_code_cache.cpp s_asm_dispatcher and
  s_single_block_asm_dispatcher. Six references total, all in the
  same TU. The 's_' prefix already signals "static" in this
  codebase's convention; the missing static keyword was an
  oversight, since the file's other s_-prefixed globals
  (s_code_buffer, s_fast_map, s_fast_map_pointers, s_blocks) all
  have the keyword.

Internalising these gives the compiler license to keep the values
in a register across the loops that read them (the storage no
longer might be modified by another TU between iterations) and
removes three weak symbols from the .so's symbol table. nm before
the change reports them with a capital B (BSS, external); after,
lowercase b (BSS, local).

The .so is +8 bytes (8048368 vs 8048360) - probably alignment
shuffle in .bss between the now-internal symbols and the rest.
25 retro_* exports unchanged.
2026-05-08 02:33:05 +02:00
..
common cd_xa: read 32-bit ADPCM word in a byte-order-independent way 2026-05-08 02:20:16 +02:00
core core: mark TU-local globals static 2026-05-08 02:33:05 +02:00
libretro libretro: clean up after BootSystem if disk-control parse fails 2026-05-08 01:15:27 +02:00
CMakeLists.txt only #include <malloc.h> if it exists 2024-07-07 23:17:16 +00:00
config.h.cmake only #include <malloc.h> if it exists 2024-07-07 23:17:16 +00:00