-
Notifications
You must be signed in to change notification settings - Fork 314
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
opt: Stacked DRG: swap buffers instead of memcpy #1197 #1198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I didn't realize that std::mem::swap 'Swaps the values at two mutable locations, without deinitializing either one.' That last part is key for this solution (at least that's what I was missing about it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks good!
I pushed a commit I think clarifies the meaning of these buffers and will help minimize confusion for future readers. This was a little easier than trying to explain my hope. If you accept these changes, I think this is good to go (after rebase).
@porcuquine LGTM |
Needs rebase. |
Resolves #1197