model: add RMW violation debug print
[c11tester.git] / snapshot-interface.h
1 /** @file snapshot-interface.h
2  *  @brief C++ layer on top of snapshotting system.
3  */
4
5
6 #ifndef __SNAPINTERFACE_H
7 #define __SNAPINTERFACE_H
8 #include "mymemory.h"
9
10 typedef unsigned int snapshot_id;
11
12 typedef void (*VoidFuncPtr)();
13 void initSnapShotLibrary(unsigned int numbackingpages,
14                 unsigned int numsnapshots, unsigned int nummemoryregions,
15                 unsigned int numheappages, VoidFuncPtr entryPoint);
16
17 struct stackEntry {
18   struct stackEntry *next;
19   snapshot_id snapshotid;
20   int index;
21 };
22
23 class SnapshotStack {
24  public:
25   MEMALLOC
26   SnapshotStack( );
27   ~SnapshotStack();
28   int backTrackBeforeStep(int seq_index);
29   void snapshotStep(int seq_index);
30
31  private:
32   struct stackEntry * stack;
33 };
34
35 /* Not sure what it even means to have more than one snapshot object,
36    so let's just make a global reference to it.*/
37
38 extern SnapshotStack * snapshotObject;
39 #endif