snapshot: rename MyFuncPtr to VoidFuncPtr
[cdsspec-compiler.git] / snapshot.h
1 #ifndef _SNAPSHOT_H
2 #define _SNAPSHOT_H
3 #define PAGESIZE 4096
4
5 /* If USE_MPROTECT_SNAPSHOT=1, then snapshot by using mmap() and mprotect()
6    If USE_MPROTECT_SNAPSHOT=0, then snapshot by using fork() */
7 #define USE_MPROTECT_SNAPSHOT 1
8
9 /* Size of signal stack */
10 #define SIGSTACKSIZE 16384
11
12 typedef unsigned int snapshot_id;
13
14 typedef void (*VoidFuncPtr)();
15 void initSnapShotLibrary(unsigned int numbackingpages,
16                 unsigned int numsnapshots, unsigned int nummemoryregions,
17                 unsigned int numheappages, VoidFuncPtr entryPoint);
18
19 void addMemoryRegionToSnapShot( void * ptr, unsigned int numPages );
20
21 snapshot_id takeSnapshot( );
22
23 void rollBack( snapshot_id theSnapShot );
24
25 void finalize();
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 void createSharedLibrary();
31 #ifdef __cplusplus
32 };  /* end of extern "C" */
33 #endif
34 #endif