[PATCH]: Updated new sparse bitmap patch

Daniel Berlin dberlin@dberlin.org
Mon Mar 26 16:47:00 GMT 2007


On 3/26/07, Olga Golovanevsky <OLGA@il.ibm.com> wrote:
>
> I am thinking to use ebitmap for struct-reorg implementation.
>
> In struct-reorg, sbitmaps are used for structure fields.
> Thus they are usually small, and can fit in one or two EBITMAP_ELT_TYPEs.
> Would it be still more efficiently to use ebitmap instead of sbitmap?
Probably.
Do you do a lot of inserts to the middle of the bitmap that would
cause it to have to move the rest of the array around?
> My guess that it will be because of cached element.
Yes.

>
> Olga
>
> On 23/20/07, Daniel Berlin <dberlin@dberlin.org> wrote:
> > +/* Set BIT in ebitmap MAP.  */
> > +
> > +void
> > +ebitmap_set_bit (ebitmap map, unsigned int bit)
> > +{
> > +  unsigned int wordindex = bit / EBITMAP_ELT_BITS;
> > +  unsigned int eltwordindex;
> > +  unsigned int bitindex;
> > +
> > +
> > +  /* If we have this element cached, just set the bit in it.  */
> > +  if (map->cache && map->cacheindex == wordindex)
> > +    {
> > +      (*map->cache) |= (EBITMAP_ELT_TYPE)1 << bitindex;
> > +      return;
> > +    }
>
> bitindex is used uninitialized.
Ya, i caught that on bootstrap, it was added in the last round of fixes i made



More information about the Gcc-patches mailing list