Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize memory usage of UI flows #112

Open
bigspider opened this issue Feb 3, 2023 · 1 comment
Open

Optimize memory usage of UI flows #112

bigspider opened this issue Feb 3, 2023 · 1 comment
Assignees

Comments

@bigspider
Copy link
Collaborator

in display.c, instead of using a union large enough to contain all the strings of the biggest UX layout, we could use the approach used here with UX_STEP_NOCB_INIT to limit the global memory usage to largest strings used in a single UX step.
That should free up over 128 bytes of RAM.

(thanks @xchapron-ledger)

@bigspider bigspider added this to the 2.2.0 milestone Feb 3, 2023
@bigspider bigspider self-assigned this Feb 6, 2023
@bigspider
Copy link
Collaborator Author

Refactoring attempted in 466daeb, 212360c and 9f3bfbd; doesn't quite save a lot of memory, although it might still be worth doing as it would likely simplify the UI flows and the g_ui_state structure.

907176a shows that a more ambitious approach of keeping the flows entirely on the stack when they are being used (and getting rid of g_ui_state altogether) would be possible.

@bigspider bigspider modified the milestones: 2.2.0, 2.1.3 May 11, 2023
@bigspider bigspider modified the milestones: 2.1.3, 2.2.0 Jun 26, 2023
@bigspider bigspider removed this from the 2.2.0 milestone Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant