[Mesa-dev] [PATCH V2 3/3] util/disk_cache: use rand_xorshift128plus() to get our random int

Grazvydas Ignotas notasas at gmail.com
Wed Mar 22 00:48:49 UTC 2017


On Wed, Mar 22, 2017 at 1:59 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> Otherwise for apps that don't seed the regular rand() we will always
> remove old cache entries from the same dirs.
>
> V2: assume bits returned by rand are independent uniformly distributed
>     bits and grab our hex value without taking the modulus of the whole
>     value, this also fixes a bug where 'f' was always missing.

I wonder if this particular random generator is any good (some sort of
LFSR?), but from quick testing it doesn't seem to have stuck bits at
least and seeding works, so probably be good enough for dir selection
purposes. For the series:

Reviewed-by: Grazvydas Ignotas <notasas at gmail.com>


More information about the mesa-dev mailing list