Add restrict
Add restrict for better pointer optimizations. This is not being applied to `addToList()' because that function we want to thread later on.
This commit is contained in:
parent
2e9326b5fb
commit
449fef2994
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
#define BLOCK_SIZE 1024
|
#define BLOCK_SIZE 1024
|
||||||
|
|
||||||
void initList(List *l) {
|
void initList(List *restrict l) {
|
||||||
l->list = malloc(sizeof(mpz_t) * BLOCK_SIZE);
|
l->list = malloc(sizeof(mpz_t) * BLOCK_SIZE);
|
||||||
if(!l->list) {
|
if(!l->list) {
|
||||||
fprintf(stderr, "Failed to allocate memory to list!\n");
|
fprintf(stderr, "Failed to allocate memory to list!\n");
|
||||||
@ -18,7 +18,7 @@ void initList(List *l) {
|
|||||||
l->end = 0;
|
l->end = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void deInitList(List *l) {
|
void deInitList(List *restrict l) {
|
||||||
for(ulli i = 0; i < l->size; ++i) {
|
for(ulli i = 0; i < l->size; ++i) {
|
||||||
mpz_clear(l->list[i]);
|
mpz_clear(l->list[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user