From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani
Eli Zaretskii wrote:
> Are you
> now saying something different from what you said back then, i.e. that=
> we cannot rely on any function/macro from lisp.h to be signal-safe?
Yes and no. As I understood it, that old conversation was about functions t= hat
explicitly signal or throw, and it's safe to assume that EQ, NILP, etc.= won't do
that. The new conversation is about running out of memory, which is a diffe= rent
form of non-local exit. There may be other forms, such as operating-system<= br> signals (I don't recall exactly).
> AFAIK, proper C++ exception handling
> requires non-trivial amounts of stack space that is not available when=
> there's stack overflow, where you have at most a single guard page= to
> work with.
There should be workarounds for that. Surely the C++ community has run into= this
problem and has solutions. If we want to support C++ modules, we need to em= ploy
them.
> What emacs-module.c does with non-local exits of _any_ kind is record<= br> > the first occurrence of such an exit, and silently return to the
> caller, thus allowing the C++ objects on the stack to be destroyed
> normally.=C2=A0 IOW, it defers the exit until internal--module-call is=
> about to return.=C2=A0 What problems do you see with that which cause = you
> to think it's error-prone, let alone dysfunctional?
It uses a different model at the C level from what one sees in Elisp, or fr= om
what one normally sees in C for that matter.=C2=A0 I don't feel that I = will really
understand the model unless I see some actual modules that do function call= s and
exception handling; but it's hard to believe that a model that does sil= ent
returns and that defers returns until later and that records some returns b= ut
not others will be problem-free. Wouldn't it be simpler to have a modul= e invoke
analogs of 'condition-case' and/or 'catch', and to dispense= with the
funcall_exit stuff?