Skip to content

Commit

Permalink
Explicitly swap the pointers on container move.
Browse files Browse the repository at this point in the history
  • Loading branch information
achirkin committed Nov 1, 2024
1 parent 281a6f9 commit e0068cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/include/raft/core/pinned_container_policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ struct pinned_container {
if (data_ != nullptr) { RAFT_CUDA_TRY_NO_THROW(cudaFreeHost(data_)); }
}

pinned_container(pinned_container&&) = default;
pinned_container& operator=(pinned_container&&) = default;
pinned_container(pinned_container&& other) { std::swap(this->data_, other.data_); }
pinned_container& operator=(pinned_container&& other) { std::swap(this->data_, other.data_); }
pinned_container(pinned_container const&) = delete; // Copying disallowed: one array one owner
pinned_container& operator=(pinned_container const&) = delete;

Expand Down

0 comments on commit e0068cd

Please sign in to comment.