Re: [RFC] [PATCH] C exceptions in kernel

From: Francois Romieu (romieu@cogenit.fr)
Date: Sat Feb 23 2002 - 12:52:09 EST


Dan Aloni <da-x@gmx.net> :
[...]
> cleanup {
> if (foo) free(foo);
                ^^
> if (bar) free(bar);
                ^^
                    
> if (locked) unlock();
                ^^
> }
> return rc;
> }
>
> Looks much better, IMHO.
>
> The cleanup() block will run after the try block even if an exception
> did not occur, and will run also if the exception occured, passing the
> exception to the next catch() or cleanup() block in stack.

Three useless "if" if no exception occured.

-- 
Ueimor
-
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/



This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:51 EST