benchtests: Avoid overflow in random memcpy/memset benchmarks
Florian Weimer
fweimer@redhat.com
Tue May 20 17:32:21 GMT 2025
* Wilco Dijkstra:
> Hi Florian,
>
>>> Use uint16_t rather than uint8_t for the size arrays.
>>>
>>> OK for commit?
>>
>> What kind of overflow is this? 8-)
>
> The copy sizes in the frequency table go up to 4095, so forcing the size to
> uint8_t means around 9.9% of the copies get cut off to 0..255 range.
So it's unsigned integer truncation, I suppose?
Thanks for the clarification,
Florian
More information about the Libc-alpha
mailing list