diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-10-11 17:42:15 +0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-11-30 15:54:15 +0000 |
commit | e1ffa594a1444e2b05dc1f4a6768d1753dc6a034 (patch) | |
tree | 334892f5a47defc76543692fe0d32307563bb62d /tests/auto | |
parent | 09c151006005d80e6343ecdd72d668a2f0cd95f4 (diff) |
Replace qrand() engine with C++11 <random> LCG and deprecate
Instead of trying to adapt to whatever the C library may have and using
QThreadLocalStorage, let's use a simple linear congruential generator
engine from <random>. We can't use a single instance because qsrand()
is documented to work per thread.
I thought of using QRandomEngine, but had to make the choice between
growing the QtCore code size and growing the per-thread data size. Code
is sharable and is actually smaller than the sizeof(QRandomEngine),
which is over 2500 bytes. sizeof(std::minstd_rand) is just
sizeof(uint_fast32_t).
Change-Id: I0a103569c81b4711a649fffd14ec8e641d02bf20
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto')
0 files changed, 0 insertions, 0 deletions