#ifndef SIMGRID_MC_SNAPSHOT_H
#define SIMGRID_MC_SNAPSHOT_H
-#include <sys/types.h> // off_t
-#include <stdint.h> // size_t
+#include <cstdint>
+#include <cstddef>
#include <vector>
#include <set>
+#include <string>
#include <memory>
+#include <sys/types.h> // off_t
+
#include <simgrid_config.h>
-#include "../xbt/mmalloc/mmprivate.h"
+#include "src/xbt/mmalloc/mmprivate.h"
#include <xbt/asserts.h>
-#include <xbt/dynar.h>
#include <xbt/base.h>
-#include "mc_forward.hpp"
-#include "ModelChecker.hpp"
-#include "PageStore.hpp"
-#include "mc_mmalloc.h"
+#include "src/mc/mc_forward.hpp"
+#include "src/mc/ModelChecker.hpp"
+#include "src/mc/PageStore.hpp"
#include "src/mc/AddressSpace.hpp"
-#include "mc_unw.h"
-#include "RegionSnapshot.hpp"
+#include "src/mc/mc_unw.h"
+#include "src/mc/RegionSnapshot.hpp"
SG_BEGIN_DECL()
~Snapshot();
const void* read_bytes(void* buffer, std::size_t size,
remote_ptr<void> address, int process_index = ProcessIndexAny,
- ReadMode mode = Normal) const override;
+ ReadOptions options = ReadOptions::none()) const override;
public: // To be private
int num_state;
std::size_t heap_bytes_used;
int privatization_index;
std::vector<std::size_t> stack_sizes;
std::vector<s_mc_snapshot_stack_t> stacks;
- std::vector<s_mc_heap_ignore_region_t> to_ignore;
+ std::vector<simgrid::mc::IgnoredHeapRegion> to_ignore;
std::uint64_t hash;
std::vector<s_mc_snapshot_ignored_data> ignored_data;
std::vector<s_fd_infos_t> current_fds;
static const void* mc_snapshot_get_heap_end(mc_snapshot_t snapshot);
-XBT_PRIVATE mc_snapshot_t MC_take_snapshot(int num_state);
-XBT_PRIVATE void MC_restore_snapshot(mc_snapshot_t);
+}
+
+#ifdef __cplusplus
+
+namespace simgrid {
+namespace mc {
+
+XBT_PRIVATE mc_snapshot_t take_snapshot(int num_state);
+XBT_PRIVATE void restore_snapshot(mc_snapshot_t);
+
+}
+}
+
+#endif
+
+extern "C" {
XBT_PRIVATE void mc_restore_page_snapshot_region(
simgrid::mc::Process* process,
SG_END_DECL()
XBT_PRIVATE int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2,
- std::vector<s_mc_heap_ignore_region_t>* i1,
- std::vector<s_mc_heap_ignore_region_t>* i2);
+ std::vector<simgrid::mc::IgnoredHeapRegion>* i1,
+ std::vector<simgrid::mc::IgnoredHeapRegion>* i2);
#endif