"Not at the beginning of a page");
size_t page_count = simgrid::mc::mmu::chunkCount(size);
- simgrid::mc::ChunkedData page_data(
- mc_model_checker->page_store(), *process, permanent_addr, page_count);
+ simgrid::mc::ChunkedData page_data(mc_model_checker->page_store(), *process, RemotePtr<void>(permanent_addr),
+ page_count);
simgrid::mc::RegionSnapshot region(
region_type, start_addr, permanent_addr, size);
static_cast<simgrid::kernel::activity::CommImpl*>(temp_synchro.getBuffer());
char* remote_name = mc_model_checker->process().read<char*>(
- (std::uint64_t)(synchro->mbox ? &synchro->mbox->name_ : &synchro->mbox_cpy->name_));
- pattern->rdv = mc_model_checker->process().read_string(remote_name);
+ RemotePtr<char*>((uint64_t)(synchro->mbox ? &synchro->mbox->name_ : &synchro->mbox_cpy->name_)));
+ pattern->rdv = mc_model_checker->process().read_string(RemotePtr<char>(remote_name));
pattern->src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(synchro->src_proc))->pid;
pattern->src_host = MC_smx_actor_get_host_name(issuer);
- simgrid::smpi::Request mpi_request =
- mc_model_checker->process().read<simgrid::smpi::Request>((std::uint64_t)simcall_comm_isend__get__data(request));
+ simgrid::smpi::Request mpi_request = mc_model_checker->process().read<simgrid::smpi::Request>(
+ RemotePtr<simgrid::smpi::Request>((std::uint64_t)simcall_comm_isend__get__data(request)));
pattern->tag = mpi_request.tag();
if (synchro->src_buff != nullptr) {
mc_model_checker->process().read(
&remote_name, remote(comm->mbox ? &simgrid::xbt::string::to_string_data(comm->mbox->name_).data
: &simgrid::xbt::string::to_string_data(comm->mbox_cpy->name_).data));
- pattern->rdv = mc_model_checker->process().read_string(remote_name);
+ pattern->rdv = mc_model_checker->process().read_string(RemotePtr<char>(remote_name));
pattern->dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->dst_proc))->pid;
pattern->dst_host = MC_smx_actor_get_host_name(issuer);
} else
// This is in snapshot do not use them directly:
const malloc_info* heapinfos1 = snapshot1->read<malloc_info*>(
- (std::uint64_t)heapinfo_address, simgrid::mc::ProcessIndexMissing);
+ RemotePtr<malloc_info*>((std::uint64_t)heapinfo_address), simgrid::mc::ProcessIndexMissing);
const malloc_info* heapinfos2 = snapshot2->read<malloc_info*>(
- (std::uint64_t)heapinfo_address, simgrid::mc::ProcessIndexMissing);
+ RemotePtr<malloc_info*>((std::uint64_t)heapinfo_address), simgrid::mc::ProcessIndexMissing);
while (i1 < state.heaplimit) {
case MC_CALL_TYPE_WAIT:
case MC_CALL_TYPE_WAITANY:
{
- simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> comm_addr = nullptr;
+ simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> comm_addr{nullptr};
if (call_type == MC_CALL_TYPE_WAIT)
comm_addr = remote(static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(req)));
process->read_bytes(&dynar, sizeof(dynar), remote_dynar);
smx_actor_t* data = static_cast<smx_actor_t*>(::operator new(dynar.elmsize * dynar.used));
- process->read_bytes(data, dynar.elmsize * dynar.used, dynar.data);
+ process->read_bytes(data, dynar.elmsize * dynar.used, simgrid::mc::RemotePtr<void>(dynar.data));
// Load each element of the vector from the MCed process:
for (unsigned int i = 0; i < dynar.used; ++i) {
simgrid::mc::ActorInformation info;
- info.address = data[i];
+ info.address = simgrid::mc::RemotePtr<simgrid::simix::ActorImpl>(data[i]);
info.hostname = nullptr;
process->read_bytes(&info.copy, sizeof(info.copy), remote(data[i]));
target.push_back(std::move(info));
static_assert(sizeof(simix_global) == sizeof(simgrid::simix::Global*),
"Bad size for simix_global");
- RemotePtr<simgrid::simix::Global> simix_global_p =
- this->read_variable<simgrid::simix::Global*>("simix_global");
+ RemotePtr<simgrid::simix::Global> simix_global_p{this->read_variable<simgrid::simix::Global*>("simix_global")};
// simix_global = REMOTE(*simix_global)
Remote<simgrid::simix::Global> simix_global =
ReadOptions options) const
{
if (process_index != simgrid::mc::ProcessIndexDisabled) {
- std::shared_ptr<simgrid::mc::ObjectInformation> const& info = this->find_object_info_rw((void*)address.address());
+ std::shared_ptr<simgrid::mc::ObjectInformation> const& info = this->find_object_info_rw(address);
// Segment overlap is not handled.
#if HAVE_SMPI
if (info.get() && this->privatized(*info)) {
class ActorInformation {
public:
/** MCed address of the process */
- RemotePtr<simgrid::simix::ActorImpl> address = nullptr;
+ RemotePtr<simgrid::simix::ActorImpl> address{nullptr};
Remote<simgrid::simix::ActorImpl> copy;
/** Hostname (owned by `mc_modelchecker->hostnames`) */
public:
RemotePtr() : address_(0) {}
- RemotePtr(std::uint64_t address) : address_(address) {}
- RemotePtr(T* address) : address_((std::uintptr_t)address) {}
- RemotePtr(Remote<T*> p) : RemotePtr(*p.getBuffer()) {}
+ explicit RemotePtr(std::nullptr_t) : address_(0) {}
+ explicit RemotePtr(std::uint64_t address) : address_(address) {}
+ explicit RemotePtr(T* address) : address_((std::uintptr_t)address) {}
+ explicit RemotePtr(Remote<T*> p) : RemotePtr(*p.getBuffer()) {}
std::uint64_t address() const { return address_; }
/** Turn into a local pointer
operator bool() const { return address_; }
bool operator!() const { return not address_; }
operator RemotePtr<void>() const { return RemotePtr<void>(address_); }
+ RemotePtr<T>& operator=(std::nullptr_t)
+ {
+ address_ = 0;
+ return *this;
+ }
RemotePtr<T> operator+(std::uint64_t n) const { return RemotePtr<T>(address_ + n * sizeof(T)); }
RemotePtr<T> operator-(std::uint64_t n) const { return RemotePtr<T>(address_ - n * sizeof(T)); }
RemotePtr<T>& operator+=(std::uint64_t n)