Messages in this thread | | | Date | Sat, 23 Feb 2002 16:13:21 +0100 | From | Felix von Leitner <> | Subject | Re: [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/
| |