MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / fill_array64

Function fill_array64

deps/jemalloc/test/src/SFMT.c:587–599  ·  view source on GitHub ↗

* This function generates pseudorandom 64-bit integers in the * specified array[] by one call. The number of pseudorandom integers * is specified by the argument size, which must be at least 312 and a * multiple of two. The generation by this function is much faster * than the following gen_rand function. * * For initialization, init_gen_rand or init_by_array must be called * before the fi

Source from the content-addressed store, hash-verified

585 * returns the pointer to the aligned memory block.
586 */
587void fill_array64(sfmt_t *ctx, uint64_t *array, int size) {
588 assert(ctx->initialized);
589 assert(ctx->idx == N32);
590 assert(size % 2 == 0);
591 assert(size >= N64);
592
593 gen_rand_array(ctx, (w128_t *)array, size / 2);
594 ctx->idx = N32;
595
596#if defined(BIG_ENDIAN64) && !defined(ONLY64)
597 swap((w128_t *)array, size /2);
598#endif
599}
600
601/**
602 * This function initializes the internal state array with a 32-bit

Callers 1

TEST_BEGINFunction · 0.50

Calls 2

gen_rand_arrayFunction · 0.70
swapFunction · 0.70

Tested by

no test coverage detected