[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Best way to save/re-load an lua state
- From: "kathrin_69@..." <kathrin_69@...>
- Date: Fri, 20 Mar 2009 12:10:05 +0100
I want to save the state of a Lua VM to a file to re-load and restart
Three options come to my mind:
1. Serializing the global index table of the VM. I even found a library
called "Pluto" which promises to do this.
2. Trying to make a deep copy of the lua_State* pointing to a VM and
save/load the binary data.
3. Trying to overwrite malloc/free for the Lua.dll, place all memory the
VM holds in an pre-allocated chunk. Save and re-load that whole chunk.
I'm not sure If I'm yet experienced (in C/C++) enough to get this done.
My Questions are:
1. Which of that options will work or which one are used and which not?
2. Are there any other options I missed?
3. Which option is most promising in terms of time and complexity?
4. Are there any other helper libraries (beside Pluto) which helps doing
one of the options?