From 93aedd2c5155478de7602db4db2c2df4c73e32e0 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Mon, 15 Jan 2007 08:01:00 -0800 Subject: Version abc70115 --- src/misc/vec/vecPtr.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/misc/vec/vecPtr.h') diff --git a/src/misc/vec/vecPtr.h b/src/misc/vec/vecPtr.h index 552c5293..c6b8defb 100644 --- a/src/misc/vec/vecPtr.h +++ b/src/misc/vec/vecPtr.h @@ -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.] -- cgit v1.2.3