diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2006-07-23 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2006-07-23 08:01:00 -0700 |
commit | 7e8e03206c56e7cd9d0d9fbb447c785c400ff3ee (patch) | |
tree | 9d31935cf6c27b36c3ceb57cb5cffe2577a569a7 /src/misc/vec | |
parent | 616bb095f10c24f1f720efe89b7f39c670d114a3 (diff) | |
download | abc-7e8e03206c56e7cd9d0d9fbb447c785c400ff3ee.tar.gz abc-7e8e03206c56e7cd9d0d9fbb447c785c400ff3ee.tar.bz2 abc-7e8e03206c56e7cd9d0d9fbb447c785c400ff3ee.zip |
Version abc60723
Diffstat (limited to 'src/misc/vec')
-rw-r--r-- | src/misc/vec/vecPtr.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/misc/vec/vecPtr.h b/src/misc/vec/vecPtr.h index 96975ff0..f2413703 100644 --- a/src/misc/vec/vecPtr.h +++ b/src/misc/vec/vecPtr.h @@ -293,6 +293,23 @@ static inline void * Vec_PtrEntry( Vec_Ptr_t * p, int i ) SeeAlso [] ***********************************************************************/ +static inline void ** Vec_PtrEntryP( Vec_Ptr_t * p, int i ) +{ + assert( i >= 0 && i < p->nSize ); + return p->pArray + i; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ static inline void Vec_PtrWriteEntry( Vec_Ptr_t * p, int i, void * Entry ) { assert( i >= 0 && i < p->nSize ); @@ -371,7 +388,10 @@ static inline void Vec_PtrFillExtra( Vec_Ptr_t * p, int nSize, void * Entry ) int i; if ( p->nSize >= nSize ) return; - Vec_PtrGrow( p, nSize ); + if ( p->nSize < 2 * nSize ) + Vec_PtrGrow( p, 2 * nSize ); + else + Vec_PtrGrow( p, p->nSize ); for ( i = p->nSize; i < nSize; i++ ) p->pArray[i] = Entry; p->nSize = nSize; |