Re: Regarding exceptions

On Sep 4, 2004, at 11:07 AM, Andy Wingo wrote:

How does it sound?

it sounds great, exception safety would be a wonderful feature for GLib and friends to have.

forgive me if i throw some fastballs at you:

c++ code that uses exceptions typically must follow a convention of allocating objects on the stack, because unwinding the stack can't clean up objects allocated on the heap (without help from catch() blocks). garbage-collected languages like perl, python, java, c#, etc can get around this restriction primarily because of the use of garbage collection (although i imagine it's still possible to get leaks if you have self-referential data structures and the like).

with that in mind, the API you propose will have to be public, and will have to be used pervasively throughout GLib and GTK+, since nearly everything those libraries do involves putting stuff on the heap.

how much of a performance and code size hit do you guess this will involve? (i know lots of C++ projects that explicitly avoid exceptions because of such penalties.) how much of the exception safety could be made magical and automatic? (it's an added layer of complexity that many app developers may skip.)

if you don't mind the leaks, could it be possible simply to re-work the innards of signal emission to fail nicely when the cleanup blocks are skipped?

Holy crap, dude, we have kids!
	-- Elysse, six days after giving birth to twins

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]