fix: actually use the size hint in util_windows.go #109
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.
This code was broken, it computed the size hint to do nothing with it.
Found with this profile:
This profile clearly show a pattern of
append
's growth.With this new code the only way to
append
is if the size hint undershoot (which would require more data to be written between theSize
andRead
calls). Might be worth apanic("race")
or returning an error if that happen ?