Make FPGA cache max age configurable

This commit is contained in:
Jude Melton-Houghton 2022-12-09 19:09:03 -05:00
parent 4948ebb8be
commit 5a403ed703
2 changed files with 8 additions and 1 deletions

View File

@ -330,9 +330,10 @@ plg.compile_with_cache = function(instr)
end
-- Entries are removed from the cache if they are unused for at least a minute.
local compile_cache_max_age = mesecon.setting("fpga_cache_max_age", 1)
local function clean_compile_cache()
for instr, entry in pairs(compile_cache) do
if entry.age < 1 then
if entry.age < compile_cache_max_age then
entry.age = entry.age + 1
else
compile_cache[instr] = nil

View File

@ -17,6 +17,12 @@ mesecon.detector_radius (Player detector scanning radius) int 6 3 16
mesecon.node_detector_distance_max (Node detector distance limit) int 10 1 16
[mesecons_fpga]
# The minimum time in minutes that unused cached FPGA configurations will be kept around.
mesecon.fpga_cache_max_age (Compile cache max age) int 1 0 10
[mesecons_luacontroller]
mesecon.luacontroller_string_rep_max (string:rep result length limit) int 64000 1000 1000000