-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: uptake atserver_message & reduce redundant memory reallocations #467
Comments
See also #466 |
So I think there's a fundamental problem with the way the connection layer provides memory back to the application. We currently have to:
Instead, we should try to allocate that message once, and use indices and carefully replace delimiters with null terminators. For example to consume the message: struct message {
unsigned char* buffer;
uint32_t buffer_len; // length of the entire buffer
uint32_t payload_idx; // index of the actual payload contents
} This struct is much more efficient to pass around, and other structs can consume it, copying just the indices rather than the whole buffer contents. Buffer is still a pointer to the start of memory allocation, so it can still be used to free at the end. To get the actual payload contents for example, the address for it would be |
added the |
Backlogging for now, we've deemed the current atsdk as enough to get c sshnpd 1.0. |
The text was updated successfully, but these errors were encountered: