guile-devel
[Top][All Lists]
Advanced

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

Re: Stack unwinding for C code


From: Dirk Herrmann
Subject: Re: Stack unwinding for C code
Date: Sat, 10 Jan 2004 12:45:58 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821

Marius Vollmer wrote:

Dirk Herrmann <address@hidden> writes:
I wouldn't prefer any of the two solutions, but I am currently not
sure what you actually suggest - especially since in the example
given below you don't pass any argument to scm_begin_frame.

The first variant (with scm_prevent_rewind) would be more elegant from
an implementational point of view.  The latter (with
SCM_F_REWINDABLE_FRAME) leads to a more desirable default behavior.  I
think people should explicitely allow rewinding when they have unwind
handlers.

Hmm, probably I am missing something, but wouldn't it just be possible to make the non-rewindable frame the default, and offer scm_allow_rewind as a function then?

It is a nice coincidence that 'free' matches the void (*func) (void
*) signature, especially since free will probably be one of the most
frequently used functions with scm_on_unwind. fclose, however, does
not match and is another candidate that may be commonly
used. Unfortunately it wouldn't be standard conforming to just cast
fclose to match the signature.

Is that a theoretical problem or do indeed platforms exist where you
can't cast fclose to (void (*)(void *))?

If it is only theoretical, I'm inclined not to worry about it...
Huh, such casts would need to be added explicitly, both in guile and in user code. I wouldn't recommend users to use such a programming style. What we do within guile is a different thing, but even here I am much in favor of having our code as standard conforming as possible - or at least encapsulate places where it isn't. Maybe we should first wait what kinds of cleanup functions we detect to be useful within guile and then decide about this issue.

Best regards
Dirk





reply via email to

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