doc: minor clarification about safe memory access #4126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Regarding Windows the documentation for
uv_write
is incorrect.From the
WSASend
documentation on MSDNThe problem is
uv_write
invokes WSASend asynchronously so in the meantime you can't access the buffers you give it.uv_write
says they must "remain valid" which is kind of ambiguous and sounds like they shouldn't be freed or something.This made a data race out of what I thought was a benign race condition in my code. I only realized this after looking through the implementation of
uv_write
.Also I realize this is from the unix implementation file and things might be different on POSIX systems, but this is the documentation that's part of the autodocs for all platforms.
Feel free to change the wording of the documentation however you like, I'd just like it to get the point across.