[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Why is the stack cleared on panic?
- From: Alexander Gladysh <agladysh@...>
- Date: Tue, 11 Jan 2011 05:01:48 +0300
On Mon, Jan 10, 2011 at 23:47, Thomas Harning Jr. <firstname.lastname@example.org> wrote:
> On Mon, Jan 10, 2011 at 11:51 AM, Alexander Gladysh <email@example.com> wrote:
> > OTOH, C++ and Lua, compiled in plain C, really do not play well together.
> Lua does indeed play well with C and C++ at the same time... no need
> to specially compile Lua as C++.
> Now, you do need to make sure that you protect your call-sites Lua->C
> so that C++ exceptions don't bubble past Lua as well as Lua errors
> don't bubble past C++ stack mgmt (always pcall).
Well, that is more or less what I meant by "do not play well together".
For C++ exceptions things are more or less under control, but I find
it almost very hard to write safe bindings in C++, so that Lua errors
would not get past C++ stack management. Looks like (almost) every Lua
function that C++ calls should be pcall-ed. I do not think that this
will be particularly fast.