lua-users home
lua-l archive

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

> The "standard" way of dealing with this is to use a double pointer or
> "handle" method where the underlying operating environment can reshuffle
> objects in memory pretty much at will. [...]
> What sorts of mechanisms does Lua have to support this?

None. However, some structures in Lua can be resized, and therefore these
structures can also be moved at will (or at least at some points, for
instance during garbage collection). At least the stack and the main
portion of tables (the array "node") can be moved.

With a small modification in "luaV_execute", I think you can also move the
array of opcodes of Lua functions ("code"). Other structures are hard
to move (that is, there may be many pointers to them or parts of them
around the code).

-- Roberto