diff options
author | Kostya Serebryany <kcc@google.com> | 2019-01-31 06:52:55 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2019-01-31 06:52:55 +0000 |
commit | 6a8fdafd02d26a9637ef16d55e951a68ac1969ea (patch) | |
tree | a23f5c7dd06114170f6f25033d38e8460badb7b0 /lib/fuzzer/FuzzerRandom.h | |
parent | 446ca1a1fc142b943ded6de387265eb0622af3db (diff) | |
download | compiler-rt-6a8fdafd02d26a9637ef16d55e951a68ac1969ea.tar.gz |
[libFuzzer] replace slow std::mt19937 with a much faster std::minstd_rand
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@352732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/fuzzer/FuzzerRandom.h')
-rw-r--r-- | lib/fuzzer/FuzzerRandom.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/fuzzer/FuzzerRandom.h b/lib/fuzzer/FuzzerRandom.h index f47579787..4dde7d84d 100644 --- a/lib/fuzzer/FuzzerRandom.h +++ b/lib/fuzzer/FuzzerRandom.h @@ -14,10 +14,10 @@ #include <random> namespace fuzzer { -class Random : public std::mt19937 { +class Random : public std::minstd_rand { public: - Random(unsigned int seed) : std::mt19937(seed) {} - result_type operator()() { return this->std::mt19937::operator()(); } + Random(unsigned int seed) : std::minstd_rand(seed) {} + result_type operator()() { return this->std::minstd_rand::operator()(); } size_t Rand() { return this->operator()(); } size_t RandBool() { return Rand() % 2; } size_t operator()(size_t n) { return n ? Rand() % n : 0; } |