Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

internal exception handlers

6 views
Skip to first unread message

Leopold Toetsch

unread,
Jan 29, 2004, 4:22:21 AM1/29/04
to P6I
We have some places in code, where we have to cleanup, if an internal
exception was thrown, e.g. after LOCK()ing a mutex or in
classes/delegate.pmc to free the saved memory structure.

Attached is a test program with some macros allowing code like:

TRY {
some();
}
CATCH {
clean_up();
RETHROW;
}

some() {
...
THROW(NULL_PMC_ACCESS);
}

The actual implementation would need either an explicit Parrot_Interp
argument or assume an C<interpreter> is around. malloc()/free() would be
replaced by a free_list handling like in C<new_internal_exception>. On
interpreter creation a few of these C<Parrot_exception>s would be
created and put onto the C<interpreter->exc_free_list>.

Some questions:
- are these macros ok? (Yes I know - debugging :)
- Can the macro names interfer with existing ones?
- do we need an additional message text like now in internal_exception?

leo

e_c.txt
0 new messages