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