[Top][All Lists]

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

Re: C++ and stack unwinding/destruction

From: David Fang
Subject: Re: C++ and stack unwinding/destruction
Date: Wed, 21 Mar 2007 18:11:05 -0500 (EST)

> > So this means I should be able to stop the dynwind from
> > plowing through any pure C++ function, in theory, right?
> Yes.
> > (I'm still itching to upgrade the libguile API for C++,
> > if I only had the time to futz with it...)
> IMHO this is possible only by wrapping libguile with
> a C++ library. And even in this case mixing the two
> dynwinds is troublesome. I am not a C++ programmer,
> but maybe using object functions to invoke the Guile/C
> API and wrapping them in scm_dynwind_begin/end...

        One possible approach could be to wrap top-level Guile/C calls in
C++ to convert dynwind exceptions into C++ exceptions, but isolate C++
exceptions to prevent them from espacing to guile/C by "rethrow"-ing with
scm_error or equivalent.

my_cxx_function(SCM arg1) {
        try {
                // actual function body that is protected from dynwinding
                // through upon error via some handler...
        } catch (...) {
                // helpful dianostic

It the idea sound? or just crazy?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]