Version abc70115

This commit is contained in:
Alan Mishchenko
2007-01-15 08:01:00 -08:00
parent 8dfe404863
commit 93aedd2c51
23 changed files with 1672 additions and 14 deletions
+26
View File
@@ -149,6 +149,32 @@ static inline Vec_Ptr_t * Vec_PtrAllocArrayCopy( void ** pArray, int nSize )
return p;
}
/**Function*************************************************************
Synopsis [Allocates the array of simulation info.]
Description [Allocates the array containing given number of entries,
each of which contains given number of unsigned words of simulation data.
The resulting array can be freed using regular procedure Vec_PtrFree().
It is the responsibility of the user to ensure this array is never grown.]
SideEffects []
SeeAlso []
***********************************************************************/
static inline Vec_Ptr_t * Vec_PtrAllocSimInfo( int nEntries, int nWords )
{
void ** pMemory;
unsigned * pInfo;
int i;
pMemory = (void **)ALLOC( char, (sizeof(void *) + sizeof(unsigned) * nWords) * nEntries );
pInfo = (unsigned *)(pMemory + nEntries);
for ( i = 0; i < nEntries; i++ )
pMemory[i] = pInfo + i * nWords;
return Vec_PtrAllocArray( pMemory, nEntries );
}
/**Function*************************************************************
Synopsis [Duplicates the integer array.]
+2
View File
@@ -61,6 +61,8 @@ struct Vec_Vec_t_
#define Vec_VecForEachEntry( vGlob, pEntry, i, k ) \
for ( i = 0; i < Vec_VecSize(vGlob); i++ ) \
Vec_PtrForEachEntry( Vec_VecEntry(vGlob, i), pEntry, k )
#define Vec_VecForEachEntryLevel( vGlob, pEntry, i, Level ) \
Vec_PtrForEachEntry( Vec_VecEntry(vGlob, Level), pEntry, i )
#define Vec_VecForEachEntryStart( vGlob, pEntry, i, k, LevelStart ) \
for ( i = LevelStart; i < Vec_VecSize(vGlob); i++ ) \
Vec_PtrForEachEntry( Vec_VecEntry(vGlob, i), pEntry, k )