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

Nicolai Hähnle nhaehnle at gmail.com
Wed Mar 22 07:14:08 UTC 2017


On 22.03.2017 01:48, Grazvydas Ignotas wrote:
> 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?)

It is definitely good enough for what we're trying to do here.


>, 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>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>



More information about the mesa-dev mailing list