Commit 0dc699f7 by Alan Mishchenko

Preventing gcc compilation errors in handling memory pages.

parent 8f91b30a
...@@ -316,7 +316,7 @@ void Sat_ProofReduce2( sat_solver2 * s ) ...@@ -316,7 +316,7 @@ void Sat_ProofReduce2( sat_solver2 * s )
vUsed = Proof_CollectUsedIter( vProof, vRoots, 1 ); vUsed = Proof_CollectUsedIter( vProof, vRoots, 1 );
// relabel nodes to use smaller space // relabel nodes to use smaller space
Vec_SetShrinkS( vProof, 1 ); Vec_SetShrinkS( vProof, 2 );
Proof_ForeachNodeVec( vUsed, vProof, pNode, i ) Proof_ForeachNodeVec( vUsed, vProof, pNode, i )
{ {
pNode->Id = Vec_SetAppendS( vProof, 2+pNode->nEnts ); pNode->Id = Vec_SetAppendS( vProof, 2+pNode->nEnts );
...@@ -379,7 +379,7 @@ void Sat_ProofReduce( sat_solver2 * s ) ...@@ -379,7 +379,7 @@ void Sat_ProofReduce( sat_solver2 * s )
vUsed = Vec_PtrAlloc( nSize ); vUsed = Vec_PtrAlloc( nSize );
// relabel nodes to use smaller space // relabel nodes to use smaller space
Vec_SetShrinkS( vProof, 1 ); Vec_SetShrinkS( vProof, 2 );
Vec_SetForEachEntry( satset *, vProof, nSize, pNode, i, j ) Vec_SetForEachEntry( satset *, vProof, nSize, pNode, i, j )
{ {
nSize = Vec_SetWordNum( 2 + pNode->nEnts ); nSize = Vec_SetWordNum( 2 + pNode->nEnts );
......
...@@ -35,7 +35,7 @@ ABC_NAMESPACE_HEADER_START ...@@ -35,7 +35,7 @@ ABC_NAMESPACE_HEADER_START
/// PARAMETERS /// /// PARAMETERS ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
#define VEC_SET_PAGE 20 #define VEC_SET_PAGE 16
#define VEC_SET_MASK 0xFFFFF #define VEC_SET_MASK 0xFFFFF
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
...@@ -70,14 +70,14 @@ static inline word * Vec_SetEntry( Vec_Set_t * p, int h ) { return p->pPa ...@@ -70,14 +70,14 @@ static inline word * Vec_SetEntry( Vec_Set_t * p, int h ) { return p->pPa
static inline int Vec_SetEntryNum( Vec_Set_t * p ) { return p->nEntries; } static inline int Vec_SetEntryNum( Vec_Set_t * p ) { return p->nEntries; }
static inline void Vec_SetWriteEntryNum( Vec_Set_t * p, int i){ p->nEntries = i; } static inline void Vec_SetWriteEntryNum( Vec_Set_t * p, int i){ p->nEntries = i; }
static inline int Vec_SetLimit( word * p ) { return ((int*)p)[0]; } static inline int Vec_SetLimit( word * p ) { return p[0]; }
static inline int Vec_SetLimitS( word * p ) { return ((int*)p)[1]; } static inline int Vec_SetLimitS( word * p ) { return p[1]; }
static inline int Vec_SetIncLimit( word * p, int nWords ) { return ((int*)p)[0] += nWords; } static inline int Vec_SetIncLimit( word * p, int nWords ) { return p[0] += nWords; }
static inline int Vec_SetIncLimitS( word * p, int nWords ) { return ((int*)p)[1] += nWords; } static inline int Vec_SetIncLimitS( word * p, int nWords ) { return p[1] += nWords; }
static inline void Vec_SetWriteLimit( word * p, int nWords ) { ((int*)p)[0] = nWords; } static inline void Vec_SetWriteLimit( word * p, int nWords ) { p[0] = nWords; }
static inline void Vec_SetWriteLimitS( word * p, int nWords ) { ((int*)p)[1] = nWords; } static inline void Vec_SetWriteLimitS( word * p, int nWords ) { p[1] = nWords; }
static inline int Vec_SetHandCurrent( Vec_Set_t * p ) { return (p->iPage << VEC_SET_PAGE) + Vec_SetLimit(p->pPages[p->iPage]); } static inline int Vec_SetHandCurrent( Vec_Set_t * p ) { return (p->iPage << VEC_SET_PAGE) + Vec_SetLimit(p->pPages[p->iPage]); }
static inline int Vec_SetHandCurrentS( Vec_Set_t * p ) { return (p->iPageS << VEC_SET_PAGE) + Vec_SetLimitS(p->pPages[p->iPageS]); } static inline int Vec_SetHandCurrentS( Vec_Set_t * p ) { return (p->iPageS << VEC_SET_PAGE) + Vec_SetLimitS(p->pPages[p->iPageS]); }
...@@ -94,7 +94,7 @@ static inline int Vec_SetMemoryAll( Vec_Set_t * p ) { return (p->iP ...@@ -94,7 +94,7 @@ static inline int Vec_SetMemoryAll( Vec_Set_t * p ) { return (p->iP
// p (page) and s (shift) are variables used here // p (page) and s (shift) are variables used here
#define Vec_SetForEachEntry( Type, pVec, nSize, pSet, p, s ) \ #define Vec_SetForEachEntry( Type, pVec, nSize, pSet, p, s ) \
for ( p = 0; p <= pVec->iPage; p++ ) \ for ( p = 0; p <= pVec->iPage; p++ ) \
for ( s = 1; s < Vec_SetLimit(pVec->pPages[p]) && ((pSet) = (Type)(pVec->pPages[p] + (s))); s += nSize ) for ( s = 2; s < Vec_SetLimit(pVec->pPages[p]) && ((pSet) = (Type)(pVec->pPages[p] + (s))); s += nSize )
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS /// /// FUNCTION DEFINITIONS ///
...@@ -118,7 +118,7 @@ static inline void Vec_SetAlloc_( Vec_Set_t * p ) ...@@ -118,7 +118,7 @@ static inline void Vec_SetAlloc_( Vec_Set_t * p )
p->pPages = ABC_CALLOC( word *, p->nPagesAlloc ); p->pPages = ABC_CALLOC( word *, p->nPagesAlloc );
p->pPages[0] = ABC_ALLOC( word, (1 << VEC_SET_PAGE) ); p->pPages[0] = ABC_ALLOC( word, (1 << VEC_SET_PAGE) );
p->pPages[0][0] = ~0; p->pPages[0][0] = ~0;
Vec_SetWriteLimit( p->pPages[0], 1 ); Vec_SetWriteLimit( p->pPages[0], 2 );
} }
static inline Vec_Set_t * Vec_SetAlloc() static inline Vec_Set_t * Vec_SetAlloc()
{ {
...@@ -145,7 +145,7 @@ static inline void Vec_SetRestart( Vec_Set_t * p ) ...@@ -145,7 +145,7 @@ static inline void Vec_SetRestart( Vec_Set_t * p )
p->iPage = 0; p->iPage = 0;
p->iPageS = 0; p->iPageS = 0;
p->pPages[0][0] = ~0; p->pPages[0][0] = ~0;
Vec_SetWriteLimit( p->pPages[0], 1 ); Vec_SetWriteLimit( p->pPages[0], 2 );
} }
/**Function************************************************************* /**Function*************************************************************
...@@ -198,8 +198,8 @@ static inline int Vec_SetAppend( Vec_Set_t * p, int * pArray, int nSize ) ...@@ -198,8 +198,8 @@ static inline int Vec_SetAppend( Vec_Set_t * p, int * pArray, int nSize )
} }
if ( p->pPages[p->iPage] == NULL ) if ( p->pPages[p->iPage] == NULL )
p->pPages[p->iPage] = ABC_ALLOC( word, (1 << VEC_SET_PAGE) ); p->pPages[p->iPage] = ABC_ALLOC( word, (1 << VEC_SET_PAGE) );
p->pPages[p->iPage][0] = ~0; Vec_SetWriteLimit( p->pPages[p->iPage], 2 );
Vec_SetWriteLimit( p->pPages[p->iPage], 1 ); Vec_SetWriteLimitS( p->pPages[p->iPage], 0 );
} }
if ( pArray ) if ( pArray )
memmove( p->pPages[p->iPage] + Vec_SetLimit(p->pPages[p->iPage]), pArray, sizeof(int) * nSize ); memmove( p->pPages[p->iPage] + Vec_SetLimit(p->pPages[p->iPage]), pArray, sizeof(int) * nSize );
...@@ -211,7 +211,7 @@ static inline int Vec_SetAppendS( Vec_Set_t * p, int nSize ) ...@@ -211,7 +211,7 @@ static inline int Vec_SetAppendS( Vec_Set_t * p, int nSize )
int nWords = Vec_SetWordNum( nSize ); int nWords = Vec_SetWordNum( nSize );
assert( nWords < (1 << VEC_SET_PAGE) ); assert( nWords < (1 << VEC_SET_PAGE) );
if ( Vec_SetLimitS( p->pPages[p->iPageS] ) + nWords > (1 << VEC_SET_PAGE) ) if ( Vec_SetLimitS( p->pPages[p->iPageS] ) + nWords > (1 << VEC_SET_PAGE) )
Vec_SetWriteLimitS( p->pPages[++p->iPageS], 1 ); Vec_SetWriteLimitS( p->pPages[++p->iPageS], 2 );
Vec_SetIncLimitS( p->pPages[p->iPageS], nWords ); Vec_SetIncLimitS( p->pPages[p->iPageS], nWords );
return Vec_SetHandCurrentS(p) - nWords; return Vec_SetHandCurrentS(p) - nWords;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment