rename MYFREE -> model_free
authorBrian Norris <banorris@uci.edu>
Tue, 2 Oct 2012 01:18:07 +0000 (18:18 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 2 Oct 2012 01:19:14 +0000 (18:19 -0700)
cyclegraph.cc
mymemory.cc
mymemory.h
nodestack.cc
snapshot-interface.cc
snapshot.cc

index 0a58e5823199a3168440e2b90b4b8b6d24cb6c9c..7f430cca6e5db962d22e2d8dd31c7873e122a9b8 100644 (file)
@@ -170,7 +170,7 @@ bool CycleGraph::checkReachable(const ModelAction *from, const ModelAction *to)
  */
 bool CycleGraph::checkReachable(CycleNode *from, CycleNode *to) {
        std::vector<CycleNode *, MyAlloc<CycleNode *> > queue;
-       HashTable<CycleNode *, CycleNode *, uintptr_t, 4, model_malloc, model_calloc, MYFREE> discovered;
+       HashTable<CycleNode *, CycleNode *, uintptr_t, 4, model_malloc, model_calloc, model_free> discovered;
 
        queue.push_back(from);
        discovered.put(from, from);
index 9fbca0391199ba6e2608bacb065d28a7a826c3c8..2add16c33868ef00d7cca763e5d87187d95baa8f 100644 (file)
@@ -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;
index a6a3c59320731d539860f4ca284a399f0cae7100..6b35f5d14f0efb46738d9389c2e8af72c9d3c6a7 100644 (file)
                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 <class T>
 
        // deallocate storage p of deleted elements
        void deallocate (pointer p, size_type num) {
-           MYFREE((void*)p);
+           model_free((void*)p);
        }
    };
 
index e59b99511b89d30d1d33ce1c81b2e5ec8f6ac4b1..23611f976dfc2c5cf35f66c65284d0e4f890b1d1 100644 (file)
@@ -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 */
index 8d7591b82efa1afccb5e00a3b5bb990c5b7447fe..47fafa5b0641f8865cb279c47f08531e9cbfd4f1 100644 (file)
@@ -124,7 +124,7 @@ int SnapshotStack::backTrackBeforeStep(int seqindex) {
                }
                struct stackEntry *tmp=stack;
                stack=stack->next;
-               MYFREE(tmp);
+               model_free(tmp);
        }
 }
 
index 2c7d84193e1feb21443696335603b951491be9af..a1dcad581985ef7f1f9ae663a446a4fb4e5a333d 100644 (file)
@@ -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; region<snapshotrecord->lastRegion;region++) {
                if( mprotect(snapshotrecord->regionsToSnapShot[region].basePtr, snapshotrecord->regionsToSnapShot[region].sizeInPages*sizeof(struct SnapShotPage), PROT_READ | PROT_WRITE ) == -1 ){
                        perror("mprotect");