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/misc/hash/hashFlt.h | |
parent | f936cc0680c98ffe51b3a1716c996072d5dbf76c (diff) | |
download | abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.gz abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.bz2 abc-0871bffae307e0553e0c5186336189e8b55cf6a6.zip |
Version abc90215
Diffstat (limited to 'src/misc/hash/hashFlt.h')
-rw-r--r-- | src/misc/hash/hashFlt.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/misc/hash/hashFlt.h b/src/misc/hash/hashFlt.h index da20ee28..43b9dd7f 100644 --- a/src/misc/hash/hashFlt.h +++ b/src/misc/hash/hashFlt.h @@ -86,11 +86,11 @@ static inline Hash_Flt_t * Hash_FltAlloc( int nBins ) Hash_Flt_t * p; int i; assert(nBins > 0); - p = ALLOC( Hash_Flt_t, 1); + p = ABC_ALLOC( Hash_Flt_t, 1); p->nBins = nBins; p->fHash = Hash_DefaultHashFunc; p->nSize = 0; - p->pArray = ALLOC( Hash_Flt_Entry_t *, nBins ); + p->pArray = ABC_ALLOC( Hash_Flt_Entry_t *, nBins ); for(i=0; i<nBins; i++) p->pArray[i] = NULL; @@ -164,7 +164,7 @@ static inline void Hash_FltWriteEntry( Hash_Flt_t *p, int key, float data ) // this key does not currently exist // create a new entry and add to bin p->nSize++; - (*pLast) = pEntry = ALLOC( Hash_Flt_Entry_t, 1 ); + (*pLast) = pEntry = ABC_ALLOC( Hash_Flt_Entry_t, 1 ); pEntry->pNext = NULL; pEntry->key = key; pEntry->data = data; @@ -206,7 +206,7 @@ static inline float Hash_FltEntry( Hash_Flt_t *p, int key, int fCreate ) if (fCreate) { // create a new entry and add to bin p->nSize++; - (*pLast) = pEntry = ALLOC( Hash_Flt_Entry_t, 1 ); + (*pLast) = pEntry = ABC_ALLOC( Hash_Flt_Entry_t, 1 ); pEntry->pNext = NULL; pEntry->key = key; pEntry->data = 0.0; @@ -249,7 +249,7 @@ static inline float* Hash_FltEntryPtr( Hash_Flt_t *p, int key ) // this key does not currently exist // create a new entry and add to bin p->nSize++; - (*pLast) = pEntry = ALLOC( Hash_Flt_Entry_t, 1 ); + (*pLast) = pEntry = ABC_ALLOC( Hash_Flt_Entry_t, 1 ); pEntry->pNext = NULL; pEntry->key = key; pEntry->data = 0.0; @@ -283,7 +283,7 @@ static inline void Hash_FltRemove( Hash_Flt_t *p, int key ) if (pEntry->key == key) { p->nSize--; *pLast = pEntry->pNext; - FREE( pEntry ); + ABC_FREE( pEntry ); return; } pLast = &(pEntry->pNext); @@ -309,18 +309,18 @@ static inline void Hash_FltFree( Hash_Flt_t *p ) { int bin; Hash_Flt_Entry_t *pEntry; - // free bins + // ABC_FREE bins for(bin = 0; bin < p->nBins; bin++) { pEntry = p->pArray[bin]; while(pEntry) { pEntry = pEntry->pNext; - FREE( pEntry ); + ABC_FREE( pEntry ); } } - // free hash - FREE( p->pArray ); - FREE( p ); + // ABC_FREE hash + ABC_FREE( p->pArray ); + ABC_FREE( p ); } //////////////////////////////////////////////////////////////////////// |