projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
snapshot: define macros with type size_t
[c11tester.git]
/
snapshotimp.h
diff --git
a/snapshotimp.h
b/snapshotimp.h
index c28b4ebf015ff0b89acf46700288d353263a66f9..656c2c58ec3df3f3acb395efb8058dd3a832c5fb 100644
(file)
--- a/
snapshotimp.h
+++ b/
snapshotimp.h
@@
-1,3
+1,7
@@
+/** @file snapshotimp.h
+ * @brief Snapshotting implementation header file..
+ */
+
#ifndef _SNAPSHOTIMP_H
#define _SNAPSHOTIMP_H
#include "snapshot.h"
#ifndef _SNAPSHOTIMP_H
#define _SNAPSHOTIMP_H
#include "snapshot.h"
@@
-7,10
+11,10
@@
#include <sys/mman.h>
#include <sys/types.h>
#include <csignal>
#include <sys/mman.h>
#include <sys/types.h>
#include <csignal>
-#define SHARED_MEMORY_DEFAULT
( 100 * ( 1 << 20 )
) // 100mb for the shared memory
-#define STACK_SIZE_DEFAULT
( ( 1 << 20 ) * 20 ) //20 mb out of the above 100 mb for my stack.
+#define SHARED_MEMORY_DEFAULT
(100 * ((size_t)1 << 20)
) // 100mb for the shared memory
+#define STACK_SIZE_DEFAULT
(((size_t)1 << 20) * 20) // 20 mb out of the above 100 mb for my stack
-#if USE_
CHECKPOINTING
+#if USE_
MPROTECT_SNAPSHOT
//Each snapshotrecord lists the firstbackingpage that must be written to revert to that snapshot
struct SnapShotRecord {
unsigned int firstBackingPage;
//Each snapshotrecord lists the firstbackingpage that must be written to revert to that snapshot
struct SnapShotRecord {
unsigned int firstBackingPage;
@@
-51,20
+55,16
@@
struct SnapShot {
//Global reference to snapshot data structure
extern struct SnapShot * snapshotrecord;
//Global reference to snapshot data structure
extern struct SnapShot * snapshotrecord;
-void * ReturnPageAlignedAddress( void *);
#else
#else
-struct Snapshot
_t
{
-
char
*mSharedMemoryBase;
-
char
*mStackBase;
+struct Snapshot
{
+
void
*mSharedMemoryBase;
+
void
*mStackBase;
size_t mStackSize;
snapshot_id mIDToRollback;
ucontext_t mContextToRollback;
snapshot_id currSnapShotID;
size_t mStackSize;
snapshot_id mIDToRollback;
ucontext_t mContextToRollback;
snapshot_id currSnapShotID;
-#if DEBUG
-struct timeval startTimeGlobal;
-#endif
volatile bool mbFinalize;
};
volatile bool mbFinalize;
};
-extern struct Snapshot
_t
* sTheRecord;
+extern struct Snapshot * sTheRecord;
#endif
#endif
#endif
#endif