-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow user to provide buffers to asynch::Session #37
Conversation
cdb58ee
to
d0bdedf
Compare
d0bdedf
to
f6c63b6
Compare
Since #35 has been merged, this is now ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I wonder if we could get rid of the const-generics but just an idea |
@AnthonyGrondin want to take a look before it gets merged? |
My knowledge of how async Rust uses memory, and static memory footprint on embedded system is still relatively, rudimentary, so I can't figure out how this saves on memory, versus using generics. Why not use two generics, one for RX and one for TX ? And for API building and user interface, is it more developer friendly to mutably borrow buffers or own them? |
This saves stack memory by allowing users to provide |
I think the code generated by today's compilers is still a bit sub-optimal by sometimes copying things on the stack and using references should mitigate that |
LGTM. I've tested before and after the change. I didn't notice a different in the Before:
After:
I'd like to also check with cargo-call-stack but I can't get it to compile for my machine. |
As I said, reduces stack size (and therefore future size) (what you are measuring with the embassy pool) by replacing with statically allocated memory. |
Closes #36