add hashtable
[model-checker.git] / mymemory.cc
index 245b2701807710bbca6c1f69ea1df662e89e9181..2c5adc0a84324e045d66e33332472bd8f7fd56e2 100644 (file)
@@ -13,6 +13,9 @@ int howManyFreed = 0;
 static mspace sStaticSpace = NULL;
 #endif
 
+//SUBRAMANIAN!!! PLEASE FIX THE MALLOC/FREE/CALLOC/ETC FOR FORK-BASED APPROACH
+//YOU HAVE NOT DONE THIS!!!!!!!!!!!
+
 /** Non-snapshotting malloc for our use. */
 
 void *MYMALLOC(size_t size) {
@@ -36,7 +39,7 @@ void *MYMALLOC(size_t size) {
                createSharedLibrary();
        }
        if( NULL == sStaticSpace )
-               sStaticSpace = create_mspace_with_base( ( void * )( sTheRecord->mSharedMemoryBase ), SHARED_MEMORY_DEFAULT -sizeof( struct Snapshot_t ), 1 );
+               sStaticSpace = create_mspace_with_base( ( void * )( sTheRecord->mSharedMemoryBase ), SHARED_MEMORY_DEFAULT -sizeof( struct Snapshot ), 1 );
        return mspace_malloc( sStaticSpace, size );
 #endif
 }
@@ -100,8 +103,6 @@ mspace mySpace = NULL;
 /** This global references the unaligned memory address that was malloced for the snapshotting heap */
 void * basemySpace = NULL;
 
-//Subramanian --- please make these work for the fork based approach
-
 /** Adding the fix for not able to allocate through a reimplemented calloc at the beginning before instantiating our allocator
 A bit circumspect about adding an sbrk. linux docs say to avoid using it... */
 
@@ -163,10 +164,8 @@ void * calloc( size_t num, size_t size ){
        return mspace_calloc( mySpace, num, size );
 }
 
-
 /** Snapshotting new operator for user programs. */
 
-
 void * operator new(size_t size) throw(std::bad_alloc) {
        return malloc(size);
 }