-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include <cstdlib>
#include <sys/mman.h>
+#ifdef __FreeBSD__
+# define MAP_POPULATE MAP_PREFAULT_READ
+#endif
#include "mc/mc.h"
-#include "src/mc/mc_snapshot.h"
+#include "src/mc/mc_snapshot.hpp"
#include "src/mc/ChunkedData.hpp"
#include "src/mc/RegionSnapshot.hpp"
void *start_addr, void* permanent_addr, size_t size)
{
// When KSM support is enables, we allocate memory using mmap:
- // * we don't want to advise bits of the heap as mergable;
- // * mmap gives data aligned on page boundaries which is merge friendly.
+ // * we don't want to advise bits of the heap as mergable
+ // * mmap gives data aligned on page boundaries which is merge friendly
simgrid::mc::Buffer data;
if (_sg_mc_ksm)
data = Buffer::mmap(size);
remote(permanent_addr),
simgrid::mc::ProcessIndexDisabled);
+#ifdef __linux__
if (_sg_mc_ksm)
// Mark the region as mergeable *after* we have written into it.
// Trying to merge them before is useless/counterproductive.
madvise(data.get(), size, MADV_MERGEABLE);
+#endif
simgrid::mc::RegionSnapshot region(
region_type, start_addr, permanent_addr, size);
RegionSnapshot sparse_region(RegionType region_type,
void *start_addr, void* permanent_addr, size_t size)
{
- simgrid::mc::Process* process = &mc_model_checker->process();
+ simgrid::mc::RemoteClient* process = &mc_model_checker->process();
assert(process != nullptr);
xbt_assert((((uintptr_t)start_addr) & (xbt_pagesize-1)) == 0,
region.page_data(std::move(page_data));
return region;
}
-
+
}
}