util/HugeAllocator: use std::exchange()
This commit is contained in:
parent
821480d329
commit
8662427d48
@ -125,9 +125,7 @@ public:
|
|||||||
:data(HugeAllocate(_size)), size(_size) {}
|
:data(HugeAllocate(_size)), size(_size) {}
|
||||||
|
|
||||||
HugeAllocation(HugeAllocation &&src) noexcept
|
HugeAllocation(HugeAllocation &&src) noexcept
|
||||||
:data(src.data), size(src.size) {
|
:data(std::exchange(src.data, nullptr)), size(src.size) {}
|
||||||
src.data = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
~HugeAllocation() {
|
~HugeAllocation() {
|
||||||
if (data != nullptr)
|
if (data != nullptr)
|
||||||
|
Loading…
Reference in New Issue
Block a user