mirror of
https://gitlab.com/gaelysam/mapgen_rivers.git
synced 2024-12-29 12:20:41 +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 ref_dem = model:define_isostasy(dem)
|
||||||
|
|
||||||
local tectonic_step = tectonic_speed * time_step
|
local tectonic_step = tectonic_speed * time_step
|
||||||
|
collectgarbage()
|
||||||
for i=1, niter do
|
for i=1, niter do
|
||||||
print("[mapgen_rivers] Iteration " .. i .. " of " .. niter)
|
print("[mapgen_rivers] Iteration " .. i .. " of " .. niter)
|
||||||
|
|
||||||
@ -43,6 +44,8 @@ local function pregenerate(keep_loaded)
|
|||||||
end
|
end
|
||||||
model:isostasy()
|
model:isostasy()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
collectgarbage()
|
||||||
end
|
end
|
||||||
model:flow()
|
model:flow()
|
||||||
|
|
||||||
@ -72,6 +75,7 @@ local function pregenerate(keep_loaded)
|
|||||||
grid.offset_x = offset_x
|
grid.offset_x = offset_x
|
||||||
grid.offset_y = offset_y
|
grid.offset_y = offset_y
|
||||||
end
|
end
|
||||||
|
collectgarbage()
|
||||||
end
|
end
|
||||||
|
|
||||||
return pregenerate
|
return pregenerate
|
||||||
|
Loading…
Reference in New Issue
Block a user