lua-users home
lua-l archive

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


Jim Mathies <Jim@mathies.com> wrote:
> I'm not sure though why you can't use the existing methods of
> dumping the entire program state out to a text file.  That ability
> in there right now right?  Why do you need to go at it from the 
> lowest level - the memory everything is stored in.  This is where 
> your going to run into cross platform issues.  Using some sort
> of standardized format in a text or binary file to load your
> objects and state back into the vm would be simpler I think.

Jim,

There isn't any built-in way in Lua that I know of to do this yet.
 
You're probably thinking of the work I was doing to do this. It walks the
globals and all tables, writes them out with unique ids and keeps track
of the ones that have already been written. To load them back, it reads
them all in and then links them all together again. 

This technique is portable except some lua data is to things like 
C-functions 
which aren't guaranteed to loading into the namespace on other lua vms, and 
C 
pointers whose value may not be meaningfull when the dump is next loaded. 
Of course, a memory dump would have similar problems.

Steve