bz1311954 - multilib variations in LC_COLLATE files, with fixes
Carlos O'Donell
codonell@redhat.com
Wed Mar 20 21:07:00 GMT 2019
On 3/20/19 4:36 PM, Rafal Luzynski wrote:
> 20.03.2019 19:25 DJ Delorie <dj@redhat.com> wrote:
>> /* Same as above, but without extra chance of overflow */
>> elem_size = next_prime (elem_size + (elem_size>>2) + (elem_size>>3));
>
> If it does not have to be exactly 1.4 then what about:
>
> elem_size = next_prime (elem_size + elem_size / 2);
>
> which is 1.5?
I vote for the >> version *and* using 1.5, which simplifies
the equation to:
elem_size = next_prime (elem_size + elem_size >> 2);
It is also the optimal number for reusing recently freed
and coalesced blocks of similar sizes from malloc via
realloc.
--
Cheers,
Carlos.
More information about the Libc-alpha
mailing list