fix(ui): collect after a rebuild so the heap is in a known state

A build allocates a spec table per node and drops them all at once, so an
app that scans WiFi right after a screen change met whatever the incremental
GC had got around to. Costs a few ms on a screen change; recovers ~24 KB.
This commit is contained in:
2026-08-04 21:30:25 -04:00
parent 4b89b27947
commit 445a9b2b8f
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -386,6 +386,11 @@ function ui.rebuild()
laidOut = true
gui.clear(ui.theme.background)
node.draw(root)
-- A build allocates a spec table per node and drops them all here, and the next thing an
-- app does may be the one that needs a contiguous WiFi buffer. Collecting now costs a few
-- milliseconds on a screen change nobody can see, and leaves the heap in a known state
-- instead of one that depends on when the incremental GC last ran.
collectgarbage()
end
function ui.draw()
File diff suppressed because one or more lines are too long