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

Use reference to the response rather than copying it #6

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

sosthene-nitrokey
Copy link
Contributor

This should reduce stack usage, see Nitrokey/nitrokey-3-firmware#312

@sosthene-nitrokey
Copy link
Contributor Author

sosthene-nitrokey commented Jul 12, 2023

Looking at the results of -Z emit-stack-sizes, this reduces this function's stack usage from 22920 bytes of stack used to just 56!
I'm still confused as to why it was so high in the first place. Only one message was ever stored on the stack, so it should be closer to 7KiB. I see similar weirdness in other functions, where the stack usage is multiple times that of the main values stored in it.

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

Successfully merging this pull request may close these issues.

3 participants