From ca4375ba4697b8abe476e03f211523c491c3e2c3 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 29 May 2012 23:35:15 -0700 Subject: [PATCH] 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. --- main.cc | 1 - snapshot-interface.h | 9 +++++++-- snapshot.h | 10 +++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/main.cc b/main.cc index 958a445..e8a2b33 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 9a2b9cc..e9746e1 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 af0130f..39e294a 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( ); -- 2.34.1