/* 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. */
/* 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. */
*
* In order to save memory when taking memory snapshots, a given byte-string
* is split in fixed-size chunks. Identical chunks (either from the same
*
* In order to save memory when taking memory snapshots, a given byte-string
* is split in fixed-size chunks. Identical chunks (either from the same
- this->clear();
- store_ = that.store_;
- pagenos_ = that.pagenos_;
- for (std::size_t const& pageno : pagenos_)
- store_->ref_page(pageno);
+ if (this != &that) {
+ this->clear();
+ store_ = that.store_;
+ pagenos_ = that.pagenos_;
+ for (std::size_t const& pageno : pagenos_)
+ store_->ref_page(pageno);
+ }
- 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);