Show
Ignore:
Timestamp:
12/12/06 18:11:31 (2 years ago)
Author:
rjrw
Message:

Eliminated BadMalloc? now MALLOC dies rather than returning on failure.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/ion_solver.cpp

    r685 r711  
    214214 
    215215                /* this will be "new" matrix, with non-adjacent coupling included */ 
    216                 if( (xmat=(double*)MALLOC( (sizeof(double)*(unsigned)(ncell*ncell) ))) == NULL ) 
    217                         BadMalloc(); 
    218                 if( (xmatsave=(double*)MALLOC( (sizeof(double)*(unsigned)(ncell*ncell) ))) == NULL ) 
    219                         BadMalloc(); 
    220                 if( (sink=(double*)MALLOC( (sizeof(double)*(unsigned)ncell ))) == NULL ) 
    221                         BadMalloc(); 
    222                 if( (source=(double*)MALLOC( (sizeof(double)*(unsigned)ncell ))) == NULL ) 
    223                         BadMalloc(); 
    224                 if( (sourcesave=(double*)MALLOC( (sizeof(double)*(unsigned)ncell ))) == NULL ) 
    225                         BadMalloc(); 
    226                 if( (ipiv=(int32*)MALLOC( (sizeof(int32)*(unsigned)ncell ))) == NULL ) 
    227                         BadMalloc(); 
     216                xmat=(double*)MALLOC( (sizeof(double)*(unsigned)(ncell*ncell) )); 
     217                xmatsave=(double*)MALLOC( (sizeof(double)*(unsigned)(ncell*ncell) )); 
     218                sink=(double*)MALLOC( (sizeof(double)*(unsigned)ncell )); 
     219                source=(double*)MALLOC( (sizeof(double)*(unsigned)ncell )); 
     220                sourcesave=(double*)MALLOC( (sizeof(double)*(unsigned)ncell )); 
     221                ipiv=(int32*)MALLOC( (sizeof(int32)*(unsigned)ncell )); 
    228222                /* auger is used only for debug printout - it is special because with multi-electron 
    229223                 * Auger ejection, very high stages of ionization can be produced, well beyond 
    230224                 * the highest stage considered here.  so we malloc to the limit */ 
    231                 if( (auger=(double*)MALLOC( (sizeof(double)*(unsigned)(LIMELM+1) ))) == NULL ) 
    232                         BadMalloc(); 
     225                auger=(double*)MALLOC( (sizeof(double)*(unsigned)(LIMELM+1) )); 
    233226        } 
    234227