Hi Akim,

In gnulib/lib/ssfmalloc-bitmap.h there is a function

/* Returns the smallest index k >= 0 for which the bit packet of c consecutive
   bits (1 <= c <= 32) is all set in the bitmap consisting of num_words words.
   Returns (size_t)(-1) if there is none.  */

I can easily extend this to c > 32. So, this will be a one-pass search for
c consecutive bits in a bitmap, that operates on words and fetches every word
only twice at most.

Is this something that could be useful for your 'bitset' module? (I know that
it's probably not useful for 'bison'.)

Bruno


Reply via email to