refactor: rename shallow_copy -> shallow_move + streamline
Use RCollector.std_copy_for where appropriate
This commit is contained in:
parent
9a494d268b
commit
d0e6ab5b44
8 changed files with 19 additions and 12 deletions
|
|
@ -156,9 +156,12 @@ namespace xo {
|
|||
}
|
||||
|
||||
DString *
|
||||
DString::shallow_move(obj<AAllocator> mm) const noexcept
|
||||
DString::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
DString * copy = (DString *)mm.alloc_copy((std::byte *)this);
|
||||
// note: not using gc.std_copy_for() here
|
||||
// b/c DString flexible array means not move-constructible
|
||||
|
||||
DString * copy = (DString *)gc.alloc_copy_for(this);
|
||||
|
||||
if (copy) {
|
||||
copy->capacity_ = capacity_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue