From fbcb205af54b85aed7d2d9a6ed1eaa91e7d70a23 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 1 Oct 2012 18:18:07 -0700 Subject: [PATCH] rename MYFREE -> model_free --- cyclegraph.cc | 2 +- mymemory.cc | 2 +- mymemory.h | 8 ++++---- nodestack.cc | 2 +- snapshot-interface.cc | 2 +- snapshot.cc | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cyclegraph.cc b/cyclegraph.cc index 0a58e58..7f430cc 100644 --- a/cyclegraph.cc +++ b/cyclegraph.cc @@ -170,7 +170,7 @@ bool CycleGraph::checkReachable(const ModelAction *from, const ModelAction *to) */ bool CycleGraph::checkReachable(CycleNode *from, CycleNode *to) { std::vector > queue; - HashTable discovered; + HashTable discovered; queue.push_back(from); discovered.put(from, from); diff --git a/mymemory.cc b/mymemory.cc index 9fbca03..2add16c 100644 --- a/mymemory.cc +++ b/mymemory.cc @@ -100,7 +100,7 @@ void system_free( void * ptr ){ } /** Non-snapshotting free for our use. */ -void MYFREE(void *ptr) { +void model_free(void *ptr) { #if USE_MPROTECT_SNAPSHOT static void (*freep)(void *); char *error; diff --git a/mymemory.h b/mymemory.h index a6a3c59..6b35f5d 100644 --- a/mymemory.h +++ b/mymemory.h @@ -14,13 +14,13 @@ return model_malloc(size);\ }\ void operator delete(void *p, size_t size) { \ - MYFREE( p ); \ + model_free( p ); \ }\ void * operator new[](size_t size) { \ return model_malloc(size);\ }\ void operator delete[](void *p, size_t size) {\ - MYFREE(p);\ + model_free(p);\ } /** SNAPSHOTALLOC declares the allocators for a class to allocate @@ -29,7 +29,7 @@ void *model_malloc(size_t size); void *model_calloc(size_t count, size_t size); -void MYFREE(void *ptr); +void model_free(void *ptr); static inline void * snapshot_malloc(size_t size) { return malloc(size); @@ -118,7 +118,7 @@ template // deallocate storage p of deleted elements void deallocate (pointer p, size_type num) { - MYFREE((void*)p); + model_free((void*)p); } }; diff --git a/nodestack.cc b/nodestack.cc index e59b995..23611f9 100644 --- a/nodestack.cc +++ b/nodestack.cc @@ -77,7 +77,7 @@ Node::~Node() if (action) delete action; if (enabled_array) - MYFREE(enabled_array); + model_free(enabled_array); } /** Prints debugging info for the ModelAction associated with this Node */ diff --git a/snapshot-interface.cc b/snapshot-interface.cc index 8d7591b..47fafa5 100644 --- a/snapshot-interface.cc +++ b/snapshot-interface.cc @@ -124,7 +124,7 @@ int SnapshotStack::backTrackBeforeStep(int seqindex) { } struct stackEntry *tmp=stack; stack=stack->next; - MYFREE(tmp); + model_free(tmp); } } diff --git a/snapshot.cc b/snapshot.cc index 2c7d841..a1dcad5 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -284,7 +284,7 @@ snapshot_id takeSnapshot( ){ */ void rollBack( snapshot_id theID ){ #if USE_MPROTECT_SNAPSHOT - HashTable< void *, bool, uintptr_t, 4, model_malloc, model_calloc, MYFREE> duplicateMap; + HashTable< void *, bool, uintptr_t, 4, model_malloc, model_calloc, model_free> duplicateMap; for(unsigned int region=0; regionlastRegion;region++) { if( mprotect(snapshotrecord->regionsToSnapShot[region].basePtr, snapshotrecord->regionsToSnapShot[region].sizeInPages*sizeof(struct SnapShotPage), PROT_READ | PROT_WRITE ) == -1 ){ perror("mprotect"); -- 2.34.1