Added invoke_plan, removed viewer

This commit is contained in:
2021-02-16 13:31:34 -05:00
parent eefe1bd58a
commit 1a6366e164
11 changed files with 128 additions and 110 deletions

View File

@@ -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