diff options
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; } |