diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-04-02 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-04-02 08:01:00 -0700 |
commit | 0080244a89eaaccd64c64af8f394486ab5d3e5b5 (patch) | |
tree | 0a0badb1e94215e0689edf36faeed7d7e9f2b88a /src/misc/extra/extraUtilMemory.c | |
parent | 2c7f6e39b84d29db096388459db7583c01b79b01 (diff) | |
download | abc-0080244a89eaaccd64c64af8f394486ab5d3e5b5.tar.gz abc-0080244a89eaaccd64c64af8f394486ab5d3e5b5.tar.bz2 abc-0080244a89eaaccd64c64af8f394486ab5d3e5b5.zip |
Version abc80402
Diffstat (limited to 'src/misc/extra/extraUtilMemory.c')
-rw-r--r-- | src/misc/extra/extraUtilMemory.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/misc/extra/extraUtilMemory.c b/src/misc/extra/extraUtilMemory.c index 6eccf015..376ed9b0 100644 --- a/src/misc/extra/extraUtilMemory.c +++ b/src/misc/extra/extraUtilMemory.c @@ -527,12 +527,12 @@ void Extra_MmStepStop( Extra_MmStep_t * p ) int i; for ( i = 0; i < p->nMems; i++ ) Extra_MmFixedStop( p->pMems[i] ); -// if ( p->pLargeChunks ) -// { -// for ( i = 0; i < p->nLargeChunks; i++ ) -// free( p->pLargeChunks[i] ); -// free( p->pLargeChunks ); -// } + if ( p->pLargeChunks ) + { + for ( i = 0; i < p->nLargeChunks; i++ ) + free( p->pLargeChunks[i] ); + free( p->pLargeChunks ); + } free( p->pMems ); free( p->pMap ); free( p ); @@ -556,18 +556,16 @@ char * Extra_MmStepEntryFetch( Extra_MmStep_t * p, int nBytes ) if ( nBytes > p->nMapSize ) { // printf( "Allocating %d bytes.\n", nBytes ); -/* +// return ALLOC( char, nBytes ); if ( p->nLargeChunks == p->nLargeChunksAlloc ) { if ( p->nLargeChunksAlloc == 0 ) - p->nLargeChunksAlloc = 5; + p->nLargeChunksAlloc = 32; p->nLargeChunksAlloc *= 2; p->pLargeChunks = REALLOC( char *, p->pLargeChunks, p->nLargeChunksAlloc ); } p->pLargeChunks[ p->nLargeChunks++ ] = ALLOC( char, nBytes ); return p->pLargeChunks[ p->nLargeChunks - 1 ]; -*/ - return ALLOC( char, nBytes ); } return Extra_MmFixedEntryFetch( p->pMap[nBytes] ); } @@ -590,7 +588,7 @@ void Extra_MmStepEntryRecycle( Extra_MmStep_t * p, char * pEntry, int nBytes ) return; if ( nBytes > p->nMapSize ) { - free( pEntry ); +// free( pEntry ); return; } Extra_MmFixedEntryRecycle( p->pMap[nBytes], pEntry ); |