-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2018. 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. */
#ifndef SIMGRID_MC_SNAPSHOT_HPP
#define SIMGRID_MC_SNAPSHOT_HPP
-#include <memory>
-#include <set>
-#include <string>
-#include <vector>
-
#include "src/mc/ModelChecker.hpp"
#include "src/mc/RegionSnapshot.hpp"
-#include "src/mc/mc_forward.hpp"
#include "src/mc/mc_unw.hpp"
-
-extern "C" {
+#include "src/mc/remote/RemoteClient.hpp"
// ***** Snapshot region
simgrid::mc::RegionSnapshot& subregion = region->privatized_data()[process_index];
return mc_translate_address_region(addr, &subregion, process_index);
}
- case simgrid::mc::StorageType::NoData:
- default:
+ default: // includes StorageType::NoData
xbt_die("Storage type not supported");
}
}
XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region(const void* addr, const simgrid::mc::Snapshot* snapshot,
int process_index);
-}
// ***** MC Snapshot
}
}
-extern "C" {
-
static XBT_ALWAYS_INLINE mc_mem_region_t mc_get_region_hinted(void* addr, simgrid::mc::Snapshot* snapshot,
int process_index, mc_mem_region_t region)
{
}
static const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot);
-}
namespace simgrid {
namespace mc {
}
}
-extern "C" {
-
XBT_PRIVATE void mc_restore_page_snapshot_region(simgrid::mc::RemoteClient* process, void* start_addr,
simgrid::mc::ChunkedData const& pagenos);
int MC_snapshot_region_memcmp(const void* addr1, mc_mem_region_t region1, const void* addr2, mc_mem_region_t region2,
std::size_t size);
-XBT_PRIVATE int MC_snapshot_memcmp(const void* addr1, simgrid::mc::Snapshot* snapshot1, const void* addr2,
- simgrid::mc::Snapshot* snapshot2, int process_index, std::size_t size);
static XBT_ALWAYS_INLINE const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot)
{
xbt_assert(region->contain(simgrid::mc::remote(addr)), "Trying to read out of the region boundary.");
switch (region->storage_type()) {
- case simgrid::mc::StorageType::NoData:
- default:
- xbt_die("Storage type not supported");
-
case simgrid::mc::StorageType::Flat:
return (char*)region->flat_data().get() + offset;
if (simgrid::mc::mmu::sameChunk((std::uintptr_t)addr, (std::uintptr_t)end)) {
// The memory is contained in a single page:
return mc_translate_address_region_chunked((uintptr_t)addr, region);
- } else {
- // The memory spans several pages:
- return MC_region_read_fragmented(region, target, addr, size);
}
+ // Otherwise, the memory spans several pages:
+ return MC_region_read_fragmented(region, target, addr, size);
}
- // We currently do not pass the process_index to this function so we assume
- // that the privatized region has been resolved in the callers:
- case simgrid::mc::StorageType::Privatized:
+ default:
+ // includes StorageType::NoData and StorageType::Privatized (we currently do not pass the process_index to this
+ // function so we assume that the privatized region has been resolved in the callers)
xbt_die("Storage type not supported");
}
}
void* res;
return *(void**)MC_region_read(region, &res, addr, sizeof(void*));
}
-}
#endif