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]

Re: [PATCH]: Updated new sparse bitmap patch


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?
My guess that it will be because of cached element.

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]