Changeset 40932 in webkit for trunk/JavaScriptCore/wtf


Ignore:
Timestamp:
Feb 12, 2009, 1:56:13 PM (16 years ago)
Author:
[email protected]
Message:

2009-02-12 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.


Fixed <rdar://problem/6582048>.

  • wtf/RandomNumber.cpp: (WTF::randomNumber): Make only one call to the random number generator on platforms where the generator is cryptographically secure. The value of randomness over and above cryptographically secure randomness is not clear, and it caused some performance problems.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/RandomNumber.cpp

    r39553 r40932  
    5252#if COMPILER(MSVC) && defined(_CRT_RAND_S)
    5353    rand_s(&part1);
    54     rand_s(&part2);
    5554    fullRandom = part1;
    56     fullRandom <<= 32;
    57     fullRandom |= part2;
    5855#elif PLATFORM(DARWIN)
    59     part1 = arc4random();
    60     part2 = arc4random();
    61     fullRandom = part1;
    62     fullRandom <<= 32;
    63     fullRandom |= part2;
     56    fullRandom = arc4random();
    6457#elif PLATFORM(UNIX)
    6558    part1 = random() & (RAND_MAX - 1);
Note: See TracChangeset for help on using the changeset viewer.