Date: Sat, 15 Jul 2006 13:44:56 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: joerg@britannica.bec.de Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: kern/99979: Get Ready for Kernel Module in C++ Message-ID: <20060715.134456.63053925.imp@bsdimp.com> In-Reply-To: <20060714074419.GC14113@britannica.bec.de> References: <20060712132059.GA3906@britannica.bec.de> <ac7deb50607122246k7df45813hf9cb34e1f8269c77@mail.gmail.com> <20060714074419.GC14113@britannica.bec.de>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20060714074419.GC14113@britannica.bec.de> Joerg Sonnenberger <joerg@britannica.bec.de> writes: : On Thu, Jul 13, 2006 at 11:16:18AM +0530, Kamal R. Prasad wrote: : > Im sorry I didn't understand you. setjmp() stores a few register contents : > [notably ip] in a jmpbuf -which are restored after a longjmp(). How is the : > try/catch mechanism more efficient than a setjmp()/longjmp() in terms of : > space/time complexity? : : Because you have to run setjmp for *every* try{}, independent of whether : it is ever actually needed. It is worse than even that. You have to run setjmp for every frame, because there could be an exception thrown from a lower frame to an upper frame and you have to cleanup your frame when that happens. Variables go out of scope, and must be destructed, etc. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060715.134456.63053925.imp>