Re: [PATCH 4/7] libihash: use fast binary scaling to determine the load

2014-05-14 Thread Neal H. Walfield
At Tue, 13 May 2014 21:02:53 +0200, Justus Winter wrote: > diff --git a/libihash/ihash.c b/libihash/ihash.c > index d628d75..f529a17 100644 > --- a/libihash/ihash.c > +++ b/libihash/ihash.c >if (ht->size) > { > - /* Only fill the hash table up to its maximum load factor. */ > -

Re: [PATCH 4/7] libihash: use fast binary scaling to determine the load

2014-05-13 Thread Samuel Thibault
Justus Winter, le Tue 13 May 2014 21:02:53 +0200, a écrit : > Expressing the maximum load in binary percent (where 128b% corresponds > to 100%) allows us to use fast binary scaling to determine if the > maximum load has been reached without losing precision. > > Furthermore, the previously used ex

[PATCH 4/7] libihash: use fast binary scaling to determine the load

2014-05-13 Thread Justus Winter
Expressing the maximum load in binary percent (where 128b% corresponds to 100%) allows us to use fast binary scaling to determine if the maximum load has been reached without losing precision. Furthermore, the previously used expression 'ht->nr_items * 100' overflows int at 2^25 (unsigned int at 2