Skip to content
Snippets Groups Projects
Commit 3785d936 authored by Jan Kadlec's avatar Jan Kadlec
Browse files

Added memory alligment instead of malloc.

 - required by pseudo-random generator.
parent 052048b4
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@ double tls_rand()
}
/* Initialize PRNG state. */
s = malloc(sizeof(dsfmt_t));
s = memalign(16, sizeof(dsfmt_t));
if (s == NULL) {
fprintf(stderr, "error: PRNG: not enough memory\n");
return .0;
......@@ -87,6 +87,7 @@ double tls_rand()
dsfmt_init_gen_rand(s, seed);
(void)pthread_setspecific(tls_prng_key, s);
}
}
return dsfmt_genrand_close_open(s);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment