lkml.org 
[lkml]   [2002]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] [PATCH] C exceptions in kernel
Thus spake Dan Aloni (da-x@gmx.net):
> The attached patch implements C exceptions in the kernel, which *don't*
> depend on special support from the compiler. This is a 'request for
> comments'. The patch is very initial, should not be applied.

First of all: setjmp/longjmp is quite inefficient.

But my real problem with this is that the point about exceptions in C++
is the automatic stack unwinding. You use local variables and if an
exception is thrown, they automatically self-destruct. In particular,
you could implement spin locks as a class, and an exception will release
the lock automatically. Since this is not there in C, this is no more
elegant than using explicit goto.

Also, it makes understanding the code (and correlating assembly output
with C code) less easy, because you also have to look at that exception
implementation.

Felix
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.255 / U:0.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site