Nick Hutchinson
2014-09-22 15:41:27 UTC
Hi,
I'm working on a x64 Linux project and we're stuck using a relatively old
version of GCC -- 4.1.
I'd wonder if someone could clarify to what extent LuaJIT integrates with C++
destructors using this version of GCC. I note the C++ Exception
Interoperability section at <http://luajit.org/extensions.html> states that
only GCC 4.3+ supports throwing Lua errors across C++ frames and having the
stack unwound correctly and destructors called.
However I've tried calling from Lua into C (via the classic API). The C
function constructs a few C++ objects with destructors, and exits via a call to
lua_error(). To my surprise, the destructors were indeed called.
Is this a happy accident, or does LuaJIT have better support for GCC < 4.3 than
that page suggests?
Cheers,
Nick
I'm working on a x64 Linux project and we're stuck using a relatively old
version of GCC -- 4.1.
I'd wonder if someone could clarify to what extent LuaJIT integrates with C++
destructors using this version of GCC. I note the C++ Exception
Interoperability section at <http://luajit.org/extensions.html> states that
only GCC 4.3+ supports throwing Lua errors across C++ frames and having the
stack unwound correctly and destructors called.
However I've tried calling from Lua into C (via the classic API). The C
function constructs a few C++ objects with destructors, and exits via a call to
lua_error(). To my surprise, the destructors were indeed called.
Is this a happy accident, or does LuaJIT have better support for GCC < 4.3 than
that page suggests?
Cheers,
Nick