This is the mail archive of the 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: [RFC PATCH] add auto_bitmap

Jeff Law <> wrote:
>On 11/14/13 04:04, wrote:
>> From: Trevor Saunders <>
>> Hi,
>> this patch adds and starts to use a class auto_bitmap, which is a
>very thin
>> wrapper around bitmap.  Its advantage is that it takes care of
>> automatically.  So you can do things like
>> int
>> f ()
>> {
>>    auto_bitmap x;
>>    // do stuff with x
>> }
>> Another advantage of this class is it puts the bitmap_head struct on
>the stack
>> instead of mallocing it or using a obstack.
>> I Think the biggest question is if I should make auto_bitmap a full
>> wrapper around   bitmap or if I should contiune just taking the
>address of it
>> and passing it as a bitmap, but other comments are of course welcome
>I'd prefer to see it fully c++ified.
>In response to one of Richi's comments, I spot checked the patch and 
>only found two occurrences where this lengthened the lifetime of the 
>bitmap in any significant way.  The vast majority of the time any 
>increase in length was trivial.
>Those instances are in tree-ssa-loop-ivopts.c and the other in 
>tree-ssa-strlen.c.  I don't think you need to change anything for them,
>I'm just pointed out that of all the stuff you changed, these were the 
>only ones I saw where lifetimes were changed significantly.

I still ask why we need a new type and cannot put this functionality into bitmap_head itself.



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