Commit 2dd6b978 by Alan Mishchenko

Reduced default growth rate of vectors in the SAT solver.

parent 6a020d6f
...@@ -48,7 +48,8 @@ static inline void veci_resize (veci* v, int k) { v->size = k; } // only ...@@ -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) static inline void veci_push (veci* v, int e)
{ {
if (v->size == v->cap) { 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->ptr = ABC_REALLOC( int, v->ptr, newsize );
v->cap = newsize; } v->cap = newsize; }
v->ptr[v->size++] = e; v->ptr[v->size++] = e;
...@@ -76,7 +77,8 @@ static inline void vecp_resize (vecp* v, int k) { v->size = k; } // only ...@@ -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) static inline void vecp_push (vecp* v, void* e)
{ {
if (v->size == v->cap) { 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->ptr = ABC_REALLOC( void*, v->ptr, newsize );
v->cap = newsize; } v->cap = newsize; }
v->ptr[v->size++] = e; v->ptr[v->size++] = e;
......
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