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/hashPtr.h | |
parent | f936cc0680c98ffe51b3a1716c996072d5dbf76c (diff) | |
download | abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.gz abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.bz2 abc-0871bffae307e0553e0c5186336189e8b55cf6a6.zip |
Version abc90215
Diffstat (limited to 'src/misc/hash/hashPtr.h')
-rw-r--r-- | src/misc/hash/hashPtr.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/misc/hash/hashPtr.h b/src/misc/hash/hashPtr.h index 15398a8a..224e5c84 100644 --- a/src/misc/hash/hashPtr.h +++ b/src/misc/hash/hashPtr.h @@ -86,11 +86,11 @@ static inline Hash_Ptr_t * Hash_PtrAlloc( int nBins ) Hash_Ptr_t * p; int i; assert(nBins > 0); - p = ALLOC( Hash_Ptr_t, 1); + p = ABC_ALLOC( Hash_Ptr_t, 1); p->nBins = nBins; p->fHash = Hash_DefaultHashFunc; p->nSize = 0; - p->pArray = ALLOC( Hash_Ptr_Entry_t *, nBins ); + p->pArray = ABC_ALLOC( Hash_Ptr_Entry_t *, nBins ); for(i=0; i<nBins; i++) p->pArray[i] = NULL; @@ -164,7 +164,7 @@ static inline void Hash_PtrWriteEntry( Hash_Ptr_t *p, int key, void * data ) // this key does not currently exist // create a new entry and add to bin p->nSize++; - (*pLast) = pEntry = ALLOC( Hash_Ptr_Entry_t, 1 ); + (*pLast) = pEntry = ABC_ALLOC( Hash_Ptr_Entry_t, 1 ); pEntry->pNext = NULL; pEntry->key = key; pEntry->data = data; @@ -206,7 +206,7 @@ static inline void * Hash_PtrEntry( Hash_Ptr_t *p, int key, int fCreate ) if (fCreate) { // create a new entry and add to bin p->nSize++; - (*pLast) = pEntry = ALLOC( Hash_Ptr_Entry_t, 1 ); + (*pLast) = pEntry = ABC_ALLOC( Hash_Ptr_Entry_t, 1 ); pEntry->pNext = NULL; pEntry->key = key; pEntry->data = NULL; @@ -249,7 +249,7 @@ static inline void** Hash_PtrEntryPtr( Hash_Ptr_t *p, int key ) // this key does not currently exist // create a new entry and add to bin p->nSize++; - (*pLast) = pEntry = ALLOC( Hash_Ptr_Entry_t, 1 ); + (*pLast) = pEntry = ABC_ALLOC( Hash_Ptr_Entry_t, 1 ); pEntry->pNext = NULL; pEntry->key = key; pEntry->data = NULL; @@ -310,18 +310,18 @@ static inline void Hash_PtrFree( Hash_Ptr_t *p ) { int bin; Hash_Ptr_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 ); } //////////////////////////////////////////////////////////////////////// |