more documentation
[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 void finalize();
17
18 void SnapshotGlobalSegments();
19
20 struct stackEntry {
21   struct stackEntry *next;
22   snapshot_id snapshotid;
23   int index;
24 };
25
26 class SnapshotStack {
27  public:
28   MEMALLOC
29   SnapshotStack( );
30   ~SnapshotStack();
31   int backTrackBeforeStep(int seq_index);
32   void snapshotStep(int seq_index);
33
34  private: 
35   struct stackEntry * stack;
36 };
37
38 /* Not sure what it even means to have more than one snapshot object,
39    so let's just make a global reference to it.*/
40
41 extern SnapshotStack * snapshotObject;
42 #endif