Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: src/IceRNG.h

Issue 807293003: Subzero: Randomize register assignment. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Simply; fix a bug; add the lit test Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceDefs.h ('k') | src/IceRegAlloc.h » ('j') | src/IceRegAlloc.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRNG.h
diff --git a/src/IceRNG.h b/src/IceRNG.h
index 5f862a8537274cf9f18714a4f47e9e22ff5ea86a..16e8f71bedcd50ff26114feec028dd4788a2846d 100644
--- a/src/IceRNG.h
+++ b/src/IceRNG.h
@@ -42,6 +42,7 @@ class RandomNumberGeneratorWrapper {
operator=(const RandomNumberGeneratorWrapper &) = delete;
public:
+ uint64_t operator()(uint64_t Max) { return RNG.next(Max); }
uint64_t next(uint64_t Max) { return RNG.next(Max); }
JF 2014/12/17 18:56:18 I'd only have operator() or next(), not both.
Jim Stichnoth 2014/12/18 18:52:03 Done. Leaving operator() for its use in std::rand
bool getTrueWithProbability(float Probability);
RandomNumberGeneratorWrapper(RandomNumberGenerator &RNG) : RNG(RNG) {}
« no previous file with comments | « src/IceDefs.h ('k') | src/IceRegAlloc.h » ('j') | src/IceRegAlloc.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698