[PATCH] D70471: scudo: Switch from std::random_shuffle to std::shuffle in a test.
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 19 15:55:25 PST 2019
pcc created this revision.
pcc added a reviewer: cryptoad.
Herald added projects: Sanitizers, LLVM.
Herald added a subscriber: Sanitizers.
This lets the test build with C++17.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D70471
Files:
compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
Index: compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
@@ -14,6 +14,7 @@
#include <condition_variable>
#include <mutex>
+#include <random>
#include <thread>
template <class SecondaryT> static void testSecondaryBasic(void) {
@@ -42,7 +43,7 @@
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();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70471.230163.patch
Type: text/x-patch
Size: 748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191119/3dc581ee/attachment.bin>
More information about the llvm-commits
mailing list