chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] random returns the same number on x86_64 a


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] random returns the same number on x86_64 all the time
Date: Sun, 4 Mar 2012 18:33:30 +0100
User-agent: Mutt/1.4.2.3i

On Sun, Mar 04, 2012 at 05:32:22PM +0100, Peter Bex wrote:
> Thanks, Jim; I used most-positive-fixnum here because I figured it should
> try to use as many bits as there are available; on 64 bit systems that
> may be 54 bits and on 32 bit systems that'll be 30 bits.

We had a talk on IRC and it seems to us that it's time to bring in
a better PRNG into Chicken core.  In the meanwhile, hash tables
should use as much randomization as is available, which is simply
RAND_MAX, which means we can just use the result of rand() directly.

The attached patch makes this happen.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: 0001-Don-t-allow-random-numbers-for-hash-tables-to-have-a.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]