diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2009-02-15 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2009-02-15 08:01:00 -0800 |
commit | 0871bffae307e0553e0c5186336189e8b55cf6a6 (patch) | |
tree | 4571d1563fe33a53a57fea1c35fb668b9d33265f /src/sat/bsat/satStore.c | |
parent | f936cc0680c98ffe51b3a1716c996072d5dbf76c (diff) | |
download | abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.gz abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.bz2 abc-0871bffae307e0553e0c5186336189e8b55cf6a6.zip |
Version abc90215
Diffstat (limited to 'src/sat/bsat/satStore.c')
-rw-r--r-- | src/sat/bsat/satStore.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/sat/bsat/satStore.c b/src/sat/bsat/satStore.c index 31fe92ca..fff8a836 100644 --- a/src/sat/bsat/satStore.c +++ b/src/sat/bsat/satStore.c @@ -23,6 +23,7 @@ #include <string.h> #include <assert.h> #include <time.h> + #include "satStore.h" //////////////////////////////////////////////////////////////////////// @@ -49,7 +50,7 @@ char * Sto_ManMemoryFetch( Sto_Man_t * p, int nBytes ) char * pMem; if ( p->pChunkLast == NULL || nBytes > p->nChunkSize - p->nChunkUsed ) { - pMem = (char *)malloc( p->nChunkSize ); + pMem = (char *)ABC_ALLOC( char, p->nChunkSize ); *(char **)pMem = p->pChunkLast; p->pChunkLast = pMem; p->nChunkUsed = sizeof(char *); @@ -76,8 +77,8 @@ void Sto_ManMemoryStop( Sto_Man_t * p ) if ( p->pChunkLast == NULL ) return; for ( pMem = p->pChunkLast; (pNext = *(char **)pMem); pMem = pNext ) - free( pMem ); - free( pMem ); + ABC_FREE( pMem ); + ABC_FREE( pMem ); } /**Function************************************************************* @@ -119,7 +120,7 @@ Sto_Man_t * Sto_ManAlloc() { Sto_Man_t * p; // allocate the manager - p = (Sto_Man_t *)malloc( sizeof(Sto_Man_t) ); + p = (Sto_Man_t *)ABC_ALLOC( char, sizeof(Sto_Man_t) ); memset( p, 0, sizeof(Sto_Man_t) ); // memory management p->nChunkSize = (1<<16); // use 64K chunks @@ -140,7 +141,7 @@ Sto_Man_t * Sto_ManAlloc() void Sto_ManFree( Sto_Man_t * p ) { Sto_ManMemoryStop( p ); - free( p ); + ABC_FREE( p ); } /**Function************************************************************* @@ -398,7 +399,7 @@ Sto_Man_t * Sto_ManLoadClauses( char * pFileName ) // alloc the array of literals nLitsAlloc = 1024; - pLits = (lit *)malloc( sizeof(lit) * nLitsAlloc ); + pLits = (lit *)ABC_ALLOC( char, sizeof(lit) * nLitsAlloc ); // read file header p->nVars = p->nClauses = p->nRoots = p->nClausesA = 0; @@ -429,7 +430,7 @@ Sto_Man_t * Sto_ManLoadClauses( char * pFileName ) if ( nLits == nLitsAlloc ) { nLitsAlloc *= 2; - pLits = (lit *)realloc( pLits, sizeof(lit) * nLitsAlloc ); + pLits = ABC_REALLOC( lit, pLits, nLitsAlloc ); } pLits[ nLits++ ] = lit_read(Number); } @@ -449,7 +450,7 @@ Sto_Man_t * Sto_ManLoadClauses( char * pFileName ) return NULL; } - free( pLits ); + ABC_FREE( pLits ); fclose( pFile ); return p; } |