mirror of https://github.com/YosysHQ/abc.git
Variable timeframe abstraction.
This commit is contained in:
parent
d931de7feb
commit
59ea100dbf
|
|
@ -56,6 +56,12 @@ static inline void veci_push (veci* v, int e)
|
|||
// int newsize = v->cap * 2;//+1;
|
||||
int newsize = (v->cap < 4) ? v->cap * 2 : (v->cap / 2) * 3;
|
||||
v->ptr = ABC_REALLOC( int, v->ptr, newsize );
|
||||
if ( v->ptr == NULL )
|
||||
{
|
||||
printf( "Failed to realloc memory from %.1f Mb to %.1f Mb.\n",
|
||||
1.0 * v->cap / (1<<20), 1.0 * newsize / (1<<20) );
|
||||
fflush( stdout );
|
||||
}
|
||||
v->cap = newsize; }
|
||||
v->ptr[v->size++] = e;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue