Crater Container Library 0.2.0
|
|
A PseudoRandom Number Generator. More...
#include <prand.h>
Data Fields | |
uint64_t | state_size |
Size of the state information for the implementation, in bytes. | |
uint32_t(* | get_u32 )(void *) |
Callback to get 4 unsigned bytes from the underlying generator. | |
bool(* | fixup_state )(void *) |
Called after "randomizing" the state. More... | |
char | state [] |
flexible length array so that the generator's state can be stored in the same allocation | |
A PseudoRandom Number Generator.
This is a generic representation, generally to be heap-allocated by one of the functions in this file. That means the prng state is stored in the flexible length array in the same allocation, decreasing memory fragmentation and making copying prng state easier.
bool(* cr8r_prng::fixup_state) (void *) |