-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add transfer function #828
base: develop
Are you sure you want to change the base?
Conversation
cc @MrBurmark |
{ | ||
auto alloc_record = findAllocationRecord(ptr); | ||
|
||
if (!(alloc_record->strategy->treatAsPassthrough() && to.getAllocationStrategy()->treatAsPassthrough())) { |
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.
So this does a direct transfer when the underlying allocators are the same, but moves when they are different? Wouldn't this allow a direct transfer between named allocators built on different base allocators? Should this take a resource to use for the copy?
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.
This looks reasonable as a start.
I have a couple of questions about certain cases. I don't remember all of the constraints on this so the implementation can remain simple.
Should there be a special case for transferring to and from the same allocator?
What about transferring from a named allocator to the underlying allocator and vice-versa?
Does this mess up the stats/counters?
No description provided.