-
Notifications
You must be signed in to change notification settings - Fork 14
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
Ideally get_interfaces()
should return an Iterator
#45
Comments
Thank you for your proposal, and I appreciate your suggestion regarding memory optimization. If you have any questions or further suggestions, please feel free to let me know. |
Would you consider PRs or would you rather work on this yourself? |
Please feel free to proceed with the PR, and I'll actively review and collaborate on the changes. |
- Fewer deps for Windows (doesn't need libc and memalloc anymore). - Somewhat safer allocation - relying on Vec + Drop which is guaranteed to run on any panic / return / etc instead of manually tracking a raw pointer for the buffer. - Increase initial buffer size as per official recommendations. - Add safe iteration helper for Windows linked lists (assuming that, if the first pointer is valid, then all others should be as well and will have the same lifetime). This significantly reduces number of individual `unsafe` usages and paves path for shellrow#45 as the entire function is now just an iterator + `.collect()`. - Simplify socket address conversions by relying on Rust's built-in endianness helpers and the SOCKADDR_INET helper union.
- Fewer deps for Windows (doesn't need libc and memalloc anymore). - Somewhat safer allocation - relying on Vec + Drop which is guaranteed to run on any panic / return / etc instead of manually tracking a raw pointer for the buffer. - Increase initial buffer size as per official recommendations. - Add safe iteration helper for Windows linked lists (assuming that, if the first pointer is valid, then all others should be as well and will have the same lifetime). This significantly reduces number of individual `unsafe` usages and paves path for shellrow#45 as the entire function is now just an iterator + `.collect()`. - Simplify socket address conversions by relying on Rust's built-in endianness helpers and the SOCKADDR_INET helper union.
Returning some iterator type instead of the whole
Vec
directly would allow consumers to have more control over how memory is allocated.This, however, would be a pretty major breaking change in the public API. If you agree with this change, I can attempt writing a PR.
The text was updated successfully, but these errors were encountered: