Skip to content

Conversation

klutvott123
Copy link
Member

Makes Page, backgroundFill, foregroundColor and globalTextOptions local to ui.lua. Removes the global variables from horuspre.lua and does the assignment in ui.lua.

I have noticed that global variables use a bit more memory than local variables. All of these variables are only used in ui.lua and can be made local. I'm printing collectgarbage("count") at the end of run_ui() on my QX7 and the total lua memory usage is about 1KB lower. The opentx statistics screen shows that "Free mem" is roughly 2-3KB higher than before which I believe indicates that peak memory usage is also reduced.

Also did some indentation fixes.

Makes Page, backgroundFill, foregroundColor and globalTextOptions local to ui.lua. Removes the global variables from horuspre.lua and does the assignment in ui.lua.
@mikeller mikeller merged commit c726802 into betaflight:master Apr 28, 2019
@klutvott123 klutvott123 deleted the memory-savings branch October 22, 2019 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants