abc/src/bool/lucky/luckyRead.c
// allocate and clear memory to store 'nTruths' truth tables of 'nVars' variables
allocate and clear memory to store 'nTruths' truth tables of 'nVars' variables
allocate and clear memory to store ' nTruths ' truth tables of ' nVars ' variables
static inline Abc_TtStore_t * Abc_TruthStoreAlloc( int nVars, int nFuncs )
{
    Abc_TtStore_t * p;
    int i;
    p = (Abc_TtStore_t *)malloc( sizeof(Abc_TtStore_t) );
    p->nVars  =  nVars;
    p->nWords = (nVars < 7) ? 1 : (1 << (nVars-6));
    p->nFuncs =  nFuncs;
    p->pFuncs = (word **)malloc( sizeof(word *) * p->nFuncs );
    p->pFuncs[0] = (word *)calloc( sizeof(word), p->nFuncs * p->nWords );
    for ( i = 1; i < p->nFuncs; i++ )
        p->pFuncs[i] = p->pFuncs[i-1] + p->nWords;
    return p;
}
static inline Abc_TtStore_t * Abc_TruthStoreAlloc ( int nVars , int nFuncs ) { Abc_TtStore_t * p ; int i ; p = ( Abc_TtStore_t * ) malloc ( sizeof ( Abc_TtStore_t ) ) ; p -> nVars = nVars ; p -> nWords = ( nVars < 7 ) ? 1 : ( 1 << ( nVars - 6 ) ) ; p -> nFuncs = nFuncs ; p -> pFuncs = ( word * * ) malloc ( sizeof ( word * ) * p -> nFuncs ) ; p -> pFuncs [ 0 ] = ( word * ) calloc ( sizeof ( word ) , p -> nFuncs * p -> nWords ) ; for ( i = 1 ; i < p -> nFuncs ; i ++ ) p -> pFuncs [ i ] = p -> pFuncs [ i - 1 ] + p -> nWords ; return p ; }
allocate and clear memory to store 'nTruths' truth tables of 'nVars' variables
allocate and clear memory to store ' nTruths ' truth tables of ' nVars ' variables
// alloc array of 'nFuncs' pointers to truth tables // alloc storage for 'nFuncs' truth tables as one chunk of memory // split it up into individual truth tables