[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.2.0 (beta-rc2) now available
- From: Mike Pall <mikelu-1106@...>
- Date: Wed, 22 Jun 2011 15:58:39 +0200
Roberto Ierusalimschy wrote:
> > It's never a good idea to export an internal structure. Especially
> > not, if it's allocated externally. You cannot add an element or
> > increase the struct size without breaking the ABI.
> Usually new Lua versions break the ABI in several other ways, so
> that does not seem a big problem.
So when you want to change the internal implementation, you may
need to break the ABI. Or you can't change the implementation.
Either case is bad.
ABI breakage, especially if it can be avoided, is not a virtue.
> > You already made that mistake with lua_Debug, please don't make it
> > again.
> What was (is) the problem with lua_Debug?
The struct is allocated outside the core VM. So it has a fixed
size and there's only one element for use as a context by the
core. There's no provision for extensibility (like padding).
That's seriously limiting the implementation choices for the core.
[You can look into the sources of LuaJIT what strange kind of
workarounds were needed to fit the context into 'int i_ci'.]