[webkit-reviews] review granted: [Bug 170045] [JSC] Use WeakRandom for SamplingProfiler interval fluctuation : [Attachment 305264] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 23 22:18:10 PDT 2017
Mark Lam <mark.lam at apple.com> has granted Yusuke Suzuki
<utatane.tea at gmail.com>'s request for review:
Bug 170045: [JSC] Use WeakRandom for SamplingProfiler interval fluctuation
https://bugs.webkit.org/show_bug.cgi?id=170045
Attachment 305264: Patch
https://bugs.webkit.org/attachment.cgi?id=305264&action=review
--- Comment #2 from Mark Lam <mark.lam at apple.com> ---
Comment on attachment 305264
--> https://bugs.webkit.org/attachment.cgi?id=305264
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=305264&action=review
r=me with comment.
> Source/JavaScriptCore/runtime/SamplingProfiler.cpp:279
> + , m_weakRandom(static_cast<unsigned>(randomNumber() *
(std::numeric_limits<unsigned>::max() + 1.0)))
Why the + 1.0? I don't think it is needed. I'm guessing you're trying to
ensure a non-zero seed, but:
1. this does guarantee a non-zero seed because
std::numeric_limits<unsigned>::max() + 1 is still 0, and
2. WeakRandom's setSeed() already guards against a 0 seed.
More information about the webkit-reviews
mailing list