Files
libretroadmin 8f1e7dcdcd libretro: size the Quake hunk from frontend-reported free memory
The hunk was a fixed compile-time size (DEFAULT_MEMSIZE_MB, 8/24/32/64 MB
depending on platform and whether the Vulkan RHI is built). That is a
blunt instrument: too small and large mods hit Hunk_Alloc failures or
thrash Cache_FreeLow; too large and constrained targets over-commit.

Add an experimental environment callback, RETRO_ENVIRONMENT_GET_MEMORY_STATUS,
that reports the frontend's free and total physical memory (bytes), and use
it to size the hunk to the running machine. We take at most a quarter of the
reported free memory, cap it at 256 MB (ample for the biggest Quake mods,
and lazily committed so the reservation is cheap on virtual-memory
platforms), and only ever grow above the per-platform default - never below
it. The value is treated as an advisory snapshot, not a licence to allocate
everything, since "free" can include reclaimable cache.

Frontends that do not implement the query return false; in that case the
core keeps the exact defaults it uses today, so behaviour is unchanged
anywhere the callback is absent. The matching frontend side is a separate
RetroArch change wiring the call to frontend_driver_get_free_memory().
2026-07-01 06:44:59 +02:00
..
2026-04-11 18:19:01 +02:00
2023-02-20 19:54:44 +01:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00
2021-11-01 21:32:47 +01:00
2021-11-01 21:32:47 +01:00
2021-11-01 21:32:47 +01:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00
2026-04-11 18:19:01 +02:00