[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 16:14:11 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG10089ce2027a: scudo: Switch from std::random_shuffle to std::shuffle in a test. (authored by pcc).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70471/new/

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.230169.patch
Type: text/x-patch
Size: 748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191120/411d09a1/attachment.bin>


More information about the llvm-commits mailing list