Added invoke_plan, removed viewer
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// LUASNAP
|
||||
//
|
||||
// A lua interpreter that can be checkpointed (snapshotted).
|
||||
// This makes it possible to roll the entire interpreter back
|
||||
// to a previously-snapshotted state.
|
||||
// A lua interpreter that can be checkpointed (snapshotted). This makes it
|
||||
// possible to roll the entire interpreter back to a previously-snapshotted
|
||||
// state.
|
||||
//
|
||||
// To accomplish this, we take advantage of the 'allocf' parameter
|
||||
// to lua_newstate. This lets us hook the lua allocator, which
|
||||
// in turn lets us find every block of memory currently in use by
|
||||
// lua. To snapshot, we 'memcpy' every block of memory
|
||||
// that lua is using into a buffer. To rollback, we just 'memcpy'
|
||||
// the data back.
|
||||
// To accomplish this, we take advantage of the 'allocf' parameter to
|
||||
// lua_newstate. This lets us hook the lua allocator, which in turn lets us
|
||||
// find every block of memory currently in use by lua. To snapshot, we 'memcpy'
|
||||
// every block of memory that lua is using into a buffer. To rollback, we just
|
||||
// 'memcpy' the data back.
|
||||
//
|
||||
// The current implementation is a proof-of-concept. It's quite
|
||||
// wasteful of memory, roughly doubling the amount of RAM that
|
||||
// LUA uses. But it does demonstrate that this method of snapshot
|
||||
// and rollback is feasible.
|
||||
// The current implementation is a proof-of-concept. It's quite wasteful of
|
||||
// memory, roughly doubling the amount of RAM that LUA uses. It's also not
|
||||
// super-fast, since it allocates tons of tiny blocks. But it totally
|
||||
// works, so it demonstrate that this method of snapshot and rollback is
|
||||
// feasible.
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef LUASNAP_HPP
|
||||
#define LUASNAP_HPP
|
||||
|
||||
Reference in New Issue
Block a user