This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
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.
Ya, i caught that on bootstrap, it was added in the last round of fixes i made
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.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |