X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e0220fb23d7a1a52b3925f3fcba8e77d4f5abfc6..89df17fd2f872e224e49bbdeeba43ca76a5b7d71:/src/mc/mc_snapshot.cpp diff --git a/src/mc/mc_snapshot.cpp b/src/mc/mc_snapshot.cpp index cd0ffaad6e..270a6aedcb 100644 --- a/src/mc/mc_snapshot.cpp +++ b/src/mc/mc_snapshot.cpp @@ -23,7 +23,8 @@ extern "C" { * @param Snapshot region in the snapshot this pointer belongs to * (or NULL if it does not belong to any snapshot region) * */ -mc_mem_region_t mc_get_snapshot_region(const void* addr, mc_snapshot_t snapshot, int process_index) +mc_mem_region_t mc_get_snapshot_region( + const void* addr, const s_mc_snapshot_t* snapshot, int process_index) { size_t n = snapshot->snapshot_regions_count; for (size_t i = 0; i != n; ++i) { @@ -34,7 +35,7 @@ mc_mem_region_t mc_get_snapshot_region(const void* addr, mc_snapshot_t snapshot, if (region->storage_type == MC_REGION_STORAGE_TYPE_PRIVATIZED) { #ifdef HAVE_SMPI // Use the current process index of the snapshot: - if (process_index == MC_PROCESS_INDEX_DISABLED) { + if (process_index == simgrid::mc::ProcessIndexDisabled) { process_index = snapshot->privatization_index; } if (process_index < 0) { @@ -183,12 +184,12 @@ Snapshot::~Snapshot() } const void* Snapshot::read_bytes(void* buffer, std::size_t size, - std::uint64_t address, int process_index, - AddressSpace::ReadMode mode) + remote_ptr address, int process_index, + AddressSpace::ReadMode mode) const { - mc_mem_region_t region = mc_get_snapshot_region((void*)address, this, process_index); + mc_mem_region_t region = mc_get_snapshot_region((void*)address.address(), this, process_index); if (region) { - const void* res = MC_region_read(region, buffer, (void*)address, size); + const void* res = MC_region_read(region, buffer, (void*)address.address(), size); if (buffer == res || mode == AddressSpace::Lazy) return res; else { @@ -197,7 +198,7 @@ const void* Snapshot::read_bytes(void* buffer, std::size_t size, } } else - return MC_process_read(this->process, mode, buffer, (void*)address, size, process_index); + return this->read_bytes(buffer, size, address, process_index, mode); } }