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: [basic-improvements] try/finally support for c/c++ - more tests


On Fri, Nov 08, 2002 at 07:58:00PM +0200, Kai Henningsen wrote:
> Minimal overhead? Your definition of minimal is certainly not mine. Setjmp/ 
> longjmp based exceptions in C are *SLOW* even for code which doesn't raise  
> exceptions.

Minimal runtime overhead primarily for the functions which don't catch nor
throw, just contain cleanups (ie. just use __try/__finally, not setjmp nor
longjmp_unwind).
Compare that to setjmp in every function which has cleanups (that is
as far as I understand the proposed solution if __try/__finally gets
shot down).
Actually, for use with longjmp_unwind as far as I understand it is enough
to just save frame pointer if -fexceptions are everywhere, the rest can be
taken care by the unwind.
As for speed of longjmp, speed of longjmp_unwind is certainly lower than of
plain longjmp, because of all the .eh_frame processing and unwinding, as
slow as is C++ throw. But IMHO exceptions are for exceptional cases, not
common cases.

	Jakub


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