This is the mail archive of the gcc@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: __attribute__((cleanup(function)) versus try/finally


On Tue, 2003-05-06 at 17:11, Richard Henderson wrote:
> On Tue, May 06, 2003 at 11:29:01AM -0700, Mark Mitchell wrote:
> > I think RTH accepts the attribute solution as well.  He would prefer
> > try/finally, as I would prefer no extension, but I think we are both
> > willing to accept the attribute.
> 
> To some extent I kind-of like the attribute solution on its own.
> It provides much more structured access to cleanups than the
> arbitrary block of code that __finally allows.
> 
> I'm not sure I want to explain to users that jumping out of the
> __finally block (via goto/break/return) will lead to undefined
> results.  It's less difficult to explain that using longjmp out
> of a function (under certain conditions) is undefined.
> 
> > In fact, that solution delivers maximum performance:
> > 
> > (1) C functions do not need to have handler code inserted.
> 
> This is false.  Handler code gets inserted with the attribute too.

I wasn't talking about the attribute solution in this context.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com


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