let us set the size of the heap in a sane way
[model-checker.git] / mymemory.cc
index ac46b1178df29eeabacdd063f85cbd9783dc5260..891a93f0d56c6b0fb083af75701badbafdb01041 100644 (file)
@@ -52,13 +52,8 @@ void MYFREE(void *ptr) {
   mspace_free( sStaticSpace, ptr );
 #endif
 }
-static mspace mySpace = NULL;
+mspace mySpace = NULL;
 void *malloc( size_t size ) {
-  if( NULL == mySpace ){
-    //void * mem = MYMALLOC( MSPACE_SIZE );
-    mySpace = create_mspace( MSPACE_SIZE, 1 );
-    AddUserHeapToSnapshot();
-  }
   return mspace_malloc( mySpace, size );
 }
 
@@ -66,13 +61,6 @@ void free( void * ptr ){
   mspace_free( mySpace, ptr );
 }
 
-void AddUserHeapToSnapshot(){
-  static bool alreadySnapshotted = false;
-  if( alreadySnapshotted ) return;
-  addMemoryRegionToSnapShot( mySpace, MSPACE_SIZE / PAGESIZE );
-}
-
-
 void * operator new(size_t size) throw(std::bad_alloc) {
   return MYMALLOC(size);
 }