From: Brian Norris Date: Wed, 30 May 2012 06:35:15 +0000 (-0700) Subject: snapshot: move declarations to the right interface header X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=ca4375ba4697b8abe476e03f211523c491c3e2c3 snapshot: move declarations to the right interface header We should have a minimal set of code/declarations in the snapshot-interface.h header. And it should not include other headers unless necessary. With this change, the model checker code only needs to use snapshot-interface.h. --- diff --git a/main.cc b/main.cc index 958a4451..e8a2b331 100644 --- a/main.cc +++ b/main.cc @@ -4,7 +4,6 @@ /* global "model" object */ #include "model.h" -#include "snapshot.h" #include "snapshot-interface.h" /* diff --git a/snapshot-interface.h b/snapshot-interface.h index 9a2b9cc1..e9746e1e 100644 --- a/snapshot-interface.h +++ b/snapshot-interface.h @@ -1,8 +1,13 @@ #ifndef __SNAPINTERFACE_H #define __SNAPINTERFACE_H -#include "snapshot.h" #include "mymemory.h" -#include "snapshot.h" + +typedef unsigned int snapshot_id; + +typedef void (*VoidFuncPtr)(); +void initSnapShotLibrary(unsigned int numbackingpages, + unsigned int numsnapshots, unsigned int nummemoryregions, + unsigned int numheappages, VoidFuncPtr entryPoint); void SnapshotGlobalSegments(); diff --git a/snapshot.h b/snapshot.h index af0130f4..39e294a8 100644 --- a/snapshot.h +++ b/snapshot.h @@ -1,5 +1,8 @@ #ifndef _SNAPSHOT_H #define _SNAPSHOT_H + +#include "snapshot-interface.h" + #define PAGESIZE 4096 /* If USE_MPROTECT_SNAPSHOT=1, then snapshot by using mmap() and mprotect() @@ -9,13 +12,6 @@ /* Size of signal stack */ #define SIGSTACKSIZE 16384 -typedef unsigned int snapshot_id; - -typedef void (*VoidFuncPtr)(); -void initSnapShotLibrary(unsigned int numbackingpages, - unsigned int numsnapshots, unsigned int nummemoryregions, - unsigned int numheappages, VoidFuncPtr entryPoint); - void addMemoryRegionToSnapShot( void * ptr, unsigned int numPages ); snapshot_id takeSnapshot( );