Skip to content

Commit 046cac6

Browse files
committed
[libFuzzer] replace slow std::mt19937 with a much faster std::minstd_rand
llvm-svn: 352732
1 parent 08c60c1 commit 046cac6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler-rt/lib/fuzzer/FuzzerRandom.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#include <random>
1515

1616
namespace fuzzer {
17-
class Random : public std::mt19937 {
17+
class Random : public std::minstd_rand {
1818
public:
19-
Random(unsigned int seed) : std::mt19937(seed) {}
20-
result_type operator()() { return this->std::mt19937::operator()(); }
19+
Random(unsigned int seed) : std::minstd_rand(seed) {}
20+
result_type operator()() { return this->std::minstd_rand::operator()(); }
2121
size_t Rand() { return this->operator()(); }
2222
size_t RandBool() { return Rand() % 2; }
2323
size_t operator()(size_t n) { return n ? Rand() % n : 0; }

0 commit comments

Comments
 (0)