[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT2 and lua_dump()
- From: Peter Cawley <lua@...>
- Date: Tue, 2 Mar 2010 13:47:51 +0000
On Tue, Mar 2, 2010 at 1:43 PM, Nicolas <email@example.com> wrote:
> My game currently handles its savefiles as a serialization of the running
> objects, since some objects can have functions dynamically attached to
> them it needs string.dump to serialize them and later reload them.
The alternative approach to serialising a function is to use the debug
API to get the filename and line number where it was defined, then
load said file, pull out the actual code, and thus save the source
code rather than bytecode.