#include <Context.hh>
Contexts can be used to restore a previous memory state for the current session.
Contexts can be thought of like savestates, where we can save and load a given checkpoint. Contexts work by performing a memcpy of the entire game heap, which is reliable since we override operator new with an EGG::Heap implementation. For variables with static storage duration, they may exist out of the heap. Thus, we need to manually copy those.
Definition at line 71 of file Context.hh.
Classes | |
| struct | Statics |
Public Member Functions | |
| Context (const Context &c) | |
| Context (Context &&c) | |
| Move constructs Context by stealing the memory block and ptrs from the provided context. | |
| Context & | operator= (const Context &rhs) |
| Context & | operator= (Context &&rhs) |
| bool | operator== (const Context &rhs) const |
Static Public Member Functions | |
| static void | SetActiveContext (const Context &rhs) |
Static Private Member Functions | |
| static size_t | RootHeapSize () |
| Derives the minimum memcpy size required to preserve the entire state of the race. | |
Private Attributes | |
| void * | m_contextMemory |
| size_t | m_contextMemoryHeapSize |
| Statics | m_statics |
| Kinoko::Host::Context::Context | ( | ) |
Definition at line 30 of file Context.cc.
| Kinoko::Host::Context::Context | ( | const Context & | c | ) |
Definition at line 74 of file Context.cc.
| Kinoko::Host::Context::Context | ( | Context && | c | ) |
Move constructs Context by stealing the memory block and ptrs from the provided context.
Definition at line 87 of file Context.cc.
| Kinoko::Host::Context::~Context | ( | ) |
Definition at line 96 of file Context.cc.
| Context & Kinoko::Host::Context::operator= | ( | const Context & | rhs | ) |
Definition at line 100 of file Context.cc.
| Context & Kinoko::Host::Context::operator= | ( | Context && | rhs | ) |
Definition at line 116 of file Context.cc.
| bool Kinoko::Host::Context::operator== | ( | const Context & | rhs | ) | const |
Definition at line 128 of file Context.cc.
|
staticnodiscardprivate |
Derives the minimum memcpy size required to preserve the entire state of the race.
This is done by finding the offset of unused contiguous memory to the end of the heap.
Definition at line 214 of file Context.cc.
|
static |
Definition at line 168 of file Context.cc.
|
private |
Definition at line 125 of file Context.hh.
|
private |
Definition at line 126 of file Context.hh.
|
private |
Definition at line 127 of file Context.hh.