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:
parent
2afe144e7f
commit
c73bfd1501
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user