mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-10 11:31:41 -10:00
Over 200 kilobytes of message buffers sat in bss whether or not rich presence was ever enabled - eight queued-command slots, the presence slot and the rpc instance, sixteen kilobytes of buffer each and more. They now allocate at discord_init and free at shutdown, with the module's entry points guarded so the pointers being null outside that window is a defined state rather than a crash; a per-function audit found four dereference paths needing the guard and the rest already gated on the rpc-valid flag. Static data drops half a megabyte together with the drive cache change; the container build compiles Discord and both validation dumps stay byte-identical.