Re: [Alephmodular-devel] Copy-on-write in practice
Status: Pre-Alpha
Brought to you by:
brefin
From: Joe A. <av...@fm...> - 2003-01-16 00:23:34
|
> OPTION 3. Arrange game-state structures explicitly in memory and > bulk-copy ... > On ExitPredictiveMode(), of course, the copy is simply deallocated and > the base pointer set back to the "real_mode" chunk of memory. Cheap > cheap, fun fun. Could we just let the predictive copy rot, and just put the base pointer back to the real_mode area? Then on ExitPredictiveMode, all we have is one pointer twiddle and one InPredictiveMode flag cleared. We also avoid allocating the memory each time. All the pointers to those objects disappear BUT we know where the chunk of memory is (it's wherever we change the base pointer to on EnterPredictiveMode), and how big it is too, so we can allocate/deallocate the entire chunk when we start/end the game. This approach feels a little wrong on a gut level, but as long as we write it right it should be fine. And I'm sure the VM system will thank us for not hitting them up for sizeof(the world) every 30th of a second. Joe Auricchio ~ av...@fm... |