summaryrefslogtreecommitdiffstats
path: root/src/aig/gia/gia.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-09-27 15:20:33 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-09-27 15:20:33 -0700
commita695d708108facb4a52571d418905b95bbd9ec9b (patch)
tree3d4c35a34976ae7aa71e601ae5252ba6ad9b931d /src/aig/gia/gia.h
parent4a74b7ced954bbe963daa92c960f3ace99037546 (diff)
downloadabc-a695d708108facb4a52571d418905b95bbd9ec9b.tar.gz
abc-a695d708108facb4a52571d418905b95bbd9ec9b.tar.bz2
abc-a695d708108facb4a52571d418905b95bbd9ec9b.zip
Performance improvements in GIA package.
Diffstat (limited to 'src/aig/gia/gia.h')
-rw-r--r--src/aig/gia/gia.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h
index eef8675f..d312f437 100644
--- a/src/aig/gia/gia.h
+++ b/src/aig/gia/gia.h
@@ -496,19 +496,20 @@ static inline Gia_Obj_t * Gia_ManAppendObj( Gia_Man_t * p )
{
if ( p->nObjs == p->nObjsAlloc )
{
- if ( 2 * p->nObjsAlloc > (1 << 29) )
+ int nObjNew = Abc_MinInt( 2 * p->nObjsAlloc, (1 << 29) );
+ if ( p->nObjs == (1 << 29) )
printf( "Hard limit on the number of nodes (2^29) is reached. Quitting...\n" ), exit(1);
if ( p->fVerbose )
- printf("Extending GIA object storage: %d -> %d.\n", p->nObjsAlloc, 2 * p->nObjsAlloc );
+ printf("Extending GIA object storage: %d -> %d.\n", p->nObjsAlloc, nObjNew );
assert( p->nObjsAlloc > 0 );
- p->pObjs = ABC_REALLOC( Gia_Obj_t, p->pObjs, 2 * p->nObjsAlloc );
- memset( p->pObjs + p->nObjsAlloc, 0, sizeof(Gia_Obj_t) * p->nObjsAlloc );
+ p->pObjs = ABC_REALLOC( Gia_Obj_t, p->pObjs, nObjNew );
+ memset( p->pObjs + p->nObjsAlloc, 0, sizeof(Gia_Obj_t) * (nObjNew - p->nObjsAlloc) );
if ( p->pMuxes )
{
- p->pMuxes = ABC_REALLOC( unsigned, p->pMuxes, 2 * p->nObjsAlloc );
- memset( p->pMuxes + p->nObjsAlloc, 0, sizeof(unsigned) * p->nObjsAlloc );
+ p->pMuxes = ABC_REALLOC( unsigned, p->pMuxes, nObjNew );
+ memset( p->pMuxes + p->nObjsAlloc, 0, sizeof(unsigned) * (nObjNew - p->nObjsAlloc) );
}
- p->nObjsAlloc *= 2;
+ p->nObjsAlloc = nObjNew;
}
return Gia_ManObj( p, p->nObjs++ );
}