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: [bitmap] cleanup


On Wed, 2004-11-24 at 10:26, Nathan Sidwell wrote:
> this one's been bothering me, so I decided to fix it.
> 

Almost completely unrelated, but is there a reason we don't have a test
if clear and set bitmap operation? I find I frequently use the idiom:

if (!bitmap_bit_p (map, b))
  {
    bitmap_set_bit (map, b);
    <...>
  }

and it seems like it would be more efficient in these cases to simply
use something like

if (bitmap_test_and_set (map, b))
  {
    <...>
  }

which would avoid at least the second call to bitmap_find_bit() every
time.

Just curious if I missed something in the past...

Andrew




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]