abc/src/bdd/cudd/cuddEssent.c
/**Function********************************************************************

  Synopsis    [Allocates a bit vector.]

  Description [Allocates a bit vector.  The parameter size gives the
  number of bits.  This procedure allocates enough long's to hold the
  specified number of bits.  Returns a pointer to the allocated vector
  if successful; NULL otherwise.]

  SideEffects [None]

  SeeAlso     [bitVectorClear bitVectorFree]

******************************************************************************/
Function
Synopsis    [Allocates a bit vector.]

Description [Allocates a bit vector.  The parameter size gives the
number of bits.  This procedure allocates enough long's to hold the
specified number of bits.  Returns a pointer to the allocated vector
if successful; NULL otherwise.]




Function Synopsis [ Allocates a bit vector . ] Description [ Allocates a bit vector . The parameter size gives the number of bits . This procedure allocates enough long ' s to hold the specified number of bits . Returns a pointer to the allocated vector if successful ; NULL otherwise . ]
static BitVector *
bitVectorAlloc(
  int size)
{
    int allocSize;
    BitVector *vector;
    allocSize = ((size - 1) / (sizeof(BitVector) * 8)) + 1;
    vector = ABC_ALLOC(BitVector, allocSize);
    if (vector == NULL) return(NULL);
    (void) memset(vector, 0, allocSize * sizeof(BitVector));
    return(vector);
}
static BitVector * bitVectorAlloc ( int size ) { int allocSize ; BitVector * vector ; allocSize = ( ( size - 1 ) / ( sizeof ( BitVector ) * 8 ) ) + 1 ; vector = ABC_ALLOC ( BitVector , allocSize ) ; if ( vector == NULL ) return ( NULL ) ; ( void ) memset ( vector , 0 , allocSize * sizeof ( BitVector ) ) ; return ( vector ) ; }
Function
Synopsis    [Allocates a bit vector.]
Function Synopsis [ Allocates a bit vector . ]
/* Find out how many long's we need.
    ** There are sizeof(long) * 8 bits in a long.
    ** The ceiling of the ratio of two integers m and n is given
    ** by ((n-1)/m)+1.  Putting all this together, we get... */ /* Clear the whole array. */