diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2007-03-28 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2007-03-28 08:01:00 -0700 |
commit | 4da784c049b79b76d8c1b82297bd27f45ead9377 (patch) | |
tree | 8e69de9f95a13f1ef6ec9f3624be997ef080dc0d /src/misc/vec | |
parent | dd5531caf916d526551049b59151990adaef575d (diff) | |
download | abc-4da784c049b79b76d8c1b82297bd27f45ead9377.tar.gz abc-4da784c049b79b76d8c1b82297bd27f45ead9377.tar.bz2 abc-4da784c049b79b76d8c1b82297bd27f45ead9377.zip |
Version abc70328
Diffstat (limited to 'src/misc/vec')
-rw-r--r-- | src/misc/vec/vecPtr.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/misc/vec/vecPtr.h b/src/misc/vec/vecPtr.h index 6b23d1ac..a53e439a 100644 --- a/src/misc/vec/vecPtr.h +++ b/src/misc/vec/vecPtr.h @@ -309,6 +309,37 @@ static inline void * Vec_PtrEntry( Vec_Ptr_t * p, int i ) /**Function************************************************************* + Synopsis [Resizes the array of simulation info.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline void Vec_PtrDoubleSimInfo( Vec_Ptr_t * vInfo ) +{ + Vec_Ptr_t * vInfoNew; + int nWords; + assert( Vec_PtrSize(vInfo) > 2 ); + // get the new array + nWords = (unsigned *)Vec_PtrEntry(vInfo,1) - (unsigned *)Vec_PtrEntry(vInfo,0); + vInfoNew = Vec_PtrAllocSimInfo( 2*Vec_PtrSize(vInfo), nWords ); + // copy the simulation info + memcpy( Vec_PtrEntry(vInfoNew,0), Vec_PtrEntry(vInfo,0), Vec_PtrSize(vInfo) * nWords * 4 ); + // replace the array + free( vInfo->pArray ); + vInfo->pArray = vInfoNew->pArray; + vInfo->nSize *= 2; + vInfo->nCap *= 2; + // free the old array + vInfoNew->pArray = NULL; + free( vInfoNew ); +} + +/**Function************************************************************* + Synopsis [] Description [] |