diff options
Diffstat (limited to 'src/sat/bsat/satVec.h')
-rw-r--r-- | src/sat/bsat/satVec.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sat/bsat/satVec.h b/src/sat/bsat/satVec.h index 4c3763e3..6e604d36 100644 --- a/src/sat/bsat/satVec.h +++ b/src/sat/bsat/satVec.h @@ -48,7 +48,8 @@ static inline void veci_resize (veci* v, int k) { v->size = k; } // only static inline void veci_push (veci* v, int e) { if (v->size == v->cap) { - int newsize = v->cap * 2;//+1; +// 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 ); v->cap = newsize; } v->ptr[v->size++] = e; @@ -76,7 +77,8 @@ static inline void vecp_resize (vecp* v, int k) { v->size = k; } // only static inline void vecp_push (vecp* v, void* e) { if (v->size == v->cap) { - int newsize = v->cap * 2;//+1; +// int newsize = v->cap * 2;//+1; + int newsize = (v->cap < 4) ? v->cap * 2 : (v->cap / 2) * 3; v->ptr = ABC_REALLOC( void*, v->ptr, newsize ); v->cap = newsize; } v->ptr[v->size++] = e; |