scudo: Switch from std::random_shuffle to std::shuffle in a test.

This lets the test build with C++17.

Differential Revision: https://reviews.llvm.org/D70471
This commit is contained in:
Peter Collingbourne 2019-11-19 13:54:12 -08:00
parent 69242e9868
commit 10089ce202

View File

@ -14,6 +14,7 @@
#include <condition_variable>
#include <mutex>
#include <random>
#include <thread>
template <class SecondaryT> static void testSecondaryBasic(void) {
@ -42,7 +43,7 @@ template <class SecondaryT> static void testSecondaryBasic(void) {
std::vector<void *> V;
for (scudo::uptr I = 0; I < 32U; I++)
V.push_back(L->allocate(Size));
std::random_shuffle(V.begin(), V.end());
std::shuffle(V.begin(), V.end(), std::mt19937(std::random_device()()));
while (!V.empty()) {
L->deallocate(V.back());
V.pop_back();