mirror of
https://gitlab.com/gaelysam/mapgen_rivers.git
synced 2024-12-28 03:40:39 +01:00
Collect garbage during pre-generation to free some space and reduce OOM problems
This commit is contained in:
parent
f7bc5ee0b4
commit
e3cadcdbc6
@ -31,6 +31,7 @@ local function pregenerate(keep_loaded)
|
||||
local ref_dem = model:define_isostasy(dem)
|
||||
|
||||
local tectonic_step = tectonic_speed * time_step
|
||||
collectgarbage()
|
||||
for i=1, niter do
|
||||
print("[mapgen_rivers] Iteration " .. i .. " of " .. niter)
|
||||
|
||||
@ -43,6 +44,8 @@ local function pregenerate(keep_loaded)
|
||||
end
|
||||
model:isostasy()
|
||||
end
|
||||
|
||||
collectgarbage()
|
||||
end
|
||||
model:flow()
|
||||
|
||||
@ -72,6 +75,7 @@ local function pregenerate(keep_loaded)
|
||||
grid.offset_x = offset_x
|
||||
grid.offset_y = offset_y
|
||||
end
|
||||
collectgarbage()
|
||||
end
|
||||
|
||||
return pregenerate
|
||||
|
Loading…
Reference in New Issue
Block a user