Changing BLOCK_SIZE default and allowing override.

The larger BLOCK_SIZE is the less time it has to spend expanding memory,
the faster it gets.
This commit is contained in:
Nicolás Ortega Froysa 2017-08-03 12:57:34 -05:00
parent 2afe144e7f
commit c73bfd1501
No known key found for this signature in database
GPG Key ID: FEC70E3BAE2E69BF

View File

@ -22,7 +22,9 @@
/** /**
* This is the number of elements by which the list expands. * This is the number of elements by which the list expands.
*/ */
#define BLOCK_SIZE 1024 #ifndef BLOCK_SIZE
#define BLOCK_SIZE 132120576
#endif
int initList(List *restrict l) { int initList(List *restrict l) {
l->list = malloc(sizeof(mpz_t) * BLOCK_SIZE); l->list = malloc(sizeof(mpz_t) * BLOCK_SIZE);