]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/sosp/ChunkedData.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
namespacing cosmetics
[simgrid.git] / src / mc / sosp / ChunkedData.hpp
index ac4e24a7d8eda0dd536c3bf64d1dfac74cef0c86..11d831610612198dd29a92422146430a9bd61ec2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -46,9 +46,9 @@ public:
     for (std::size_t const& pageno : pagenos_)
       store_->ref_page(pageno);
   }
-  ChunkedData(ChunkedData&& that) : store_(that.store_), pagenos_(std::move(that.pagenos_))
+  ChunkedData(ChunkedData&& that) noexcept : pagenos_(std::move(that.pagenos_))
   {
-    that.store_ = nullptr;
+    std::swap(store_, that.store_);
     that.pagenos_.clear();
   }
   ChunkedData& operator=(ChunkedData const& that)
@@ -62,7 +62,7 @@ public:
     }
     return *this;
   }
-  ChunkedData& operator=(ChunkedData&& that)
+  ChunkedData& operator=(ChunkedData&& that) noexcept
   {
     this->clear();
     store_      = that.store_;
@@ -82,9 +82,9 @@ public:
   const std::size_t* pagenos() const { return pagenos_.data(); }
 
   /** Get a a pointer to a chunk */
-  const void* page(std::size_t i) const { return store_->get_page(pagenos_[i]); }
+  void* page(std::size_t i) const { return store_->get_page(pagenos_[i]); }
 
-  ChunkedData(PageStore& store, AddressSpace& as, RemotePtr<void> addr, std::size_t page_count);
+  ChunkedData(PageStore& store, const AddressSpace& as, RemotePtr<void> addr, std::size_t page_count);
 };
 
 } // namespace mc