You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR is a set of small cleanups to reduce `memcpy` and `memset` calls in
`Buffer` wrangling.
- `Buffer::eat` just swaps pointers if it's a complete (fully owned) overwrite,
instead of using `memcpy`
- `Buffer::eat` no longer sets the size of the eaten buffer to 0, to avoid
`memset` when scaling it up later
- Added a new `Buffer:reset_owned`, which resizes and clears the `owned` flags
but **does not** clear buffer data (for the case where we're about to
overwrite buffer data anyways)
- Use this new function in `Volume::read`
- In `Volume::read`, read directly into the provided buffer if there's only one
subvolume (instead of reading into a scratch buffer then copying)
- The scratch buffer is no longer always allocated; it's resized if needed
0 commit comments