New assertions and bug fix in DSD balancing.

This commit is contained in:
Alan Mishchenko
2015-01-27 09:54:35 -08:00
parent 8ff4b79fc2
commit 0f22046bcb
9 changed files with 90 additions and 16 deletions
+10
View File
@@ -86,6 +86,16 @@ static inline Vec_Flt_t * Vec_FltAlloc( int nCap )
p->pArray = p->nCap? ABC_ALLOC( float, p->nCap ) : NULL;
return p;
}
static inline Vec_Flt_t * Vec_FltAllocExact( int nCap )
{
Vec_Flt_t * p;
assert( nCap >= 0 );
p = ABC_ALLOC( Vec_Flt_t, 1 );
p->nSize = 0;
p->nCap = nCap;
p->pArray = p->nCap? ABC_ALLOC( float, p->nCap ) : NULL;
return p;
}
/**Function*************************************************************
+10
View File
@@ -96,6 +96,16 @@ static inline Vec_Int_t * Vec_IntAlloc( int nCap )
p->pArray = p->nCap? ABC_ALLOC( int, p->nCap ) : NULL;
return p;
}
static inline Vec_Int_t * Vec_IntAllocExact( int nCap )
{
Vec_Int_t * p;
assert( nCap >= 0 );
p = ABC_ALLOC( Vec_Int_t, 1 );
p->nSize = 0;
p->nCap = nCap;
p->pArray = p->nCap? ABC_ALLOC( int, p->nCap ) : NULL;
return p;
}
/**Function*************************************************************
+10
View File
@@ -91,6 +91,16 @@ static inline Vec_Ptr_t * Vec_PtrAlloc( int nCap )
p->pArray = p->nCap? ABC_ALLOC( void *, p->nCap ) : NULL;
return p;
}
static inline Vec_Ptr_t * Vec_PtrAllocExact( int nCap )
{
Vec_Ptr_t * p;
assert( nCap >= 0 );
p = ABC_ALLOC( Vec_Ptr_t, 1 );
p->nSize = 0;
p->nCap = nCap;
p->pArray = p->nCap? ABC_ALLOC( void *, p->nCap ) : NULL;
return p;
}
/**Function*************************************************************
+10
View File
@@ -80,6 +80,16 @@ static inline Vec_Str_t * Vec_StrAlloc( int nCap )
p->pArray = p->nCap? ABC_ALLOC( char, p->nCap ) : NULL;
return p;
}
static inline Vec_Str_t * Vec_StrAllocExact( int nCap )
{
Vec_Str_t * p;
assert( nCap >= 0 );
p = ABC_ALLOC( Vec_Str_t, 1 );
p->nSize = 0;
p->nCap = nCap;
p->pArray = p->nCap? ABC_ALLOC( char, p->nCap ) : NULL;
return p;
}
/**Function*************************************************************
+10
View File
@@ -95,6 +95,16 @@ static inline Vec_Wec_t * Vec_WecAlloc( int nCap )
p->pArray = p->nCap? ABC_CALLOC( Vec_Int_t, p->nCap ) : NULL;
return p;
}
static inline Vec_Wec_t * Vec_WecAllocExact( int nCap )
{
Vec_Wec_t * p;
assert( nCap >= 0 );
p = ABC_ALLOC( Vec_Wec_t, 1 );
p->nSize = 0;
p->nCap = nCap;
p->pArray = p->nCap? ABC_CALLOC( Vec_Int_t, p->nCap ) : NULL;
return p;
}
static inline Vec_Wec_t * Vec_WecStart( int nSize )
{
Vec_Wec_t * p;
+10
View File
@@ -88,6 +88,16 @@ static inline Vec_Wrd_t * Vec_WrdAlloc( int nCap )
p->pArray = p->nCap? ABC_ALLOC( word, p->nCap ) : NULL;
return p;
}
static inline Vec_Wrd_t * Vec_WrdAllocExact( int nCap )
{
Vec_Wrd_t * p;
assert( nCap >= 0 );
p = ABC_ALLOC( Vec_Wrd_t, 1 );
p->nSize = 0;
p->nCap = nCap;
p->pArray = p->nCap? ABC_ALLOC( word, p->nCap ) : NULL;
return p;
}
/**Function*************************************************************