[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Best way to save/re-load an lua state
- From: Peter Cawley <lua@...>
- Date: Mon, 23 Mar 2009 13:18:27 +0000
On Sat, Mar 21, 2009 at 3:26 PM, David Given <firstname.lastname@example.org> wrote:
> This will only work if you new buffer is loaded at the same address as
> the old one, as there'll be pointers embedded all throughout the data.
> And if there happen to be pointers anywhere else --- such as on the
> stack --- then you will be in for what is technically known as A World
> Of Pain!
A much more interesting (read: technically challenging) solution would
be to try and use x86 segment registers to allow the buffer to be
loaded at different addresses and have an entry in the LDT pointing at
the base of the buffer. (I've been reading too much of Google's
NativeClient codebase and it's usage of segments).