jdeans289 / icg2

Interface Code Generator 2: Electric Boogaloo
Other
0 stars 2 forks source link

Partial Checkpoints #25

Open jdeans289 opened 12 months ago

jdeans289 commented 12 months ago

Currently the MemoryManager::writeCheckpoint always passes everything into the checkpoint agent. We want to be able to checkpoint a subset of the allocations. Need to think about how to deal with pointers here, and what options we want to make available to the user.

For example, a class that looks something like this might be common:

class MyClass {
// normal members
int x[5];

// a pointer that we manage
int * my_resource;

// a pointer that is just used to reference some other big object that we don't manage
SomeOtherBigManager * manager;
}

If an instance of MyClass is being checkpointed, it would make sense that we also want to fully checkpoint my_resource as well, but we probably don't want to checkpoint the entirety of manager, but we want to be able to restore the pointer to it. This determination will probably have to be up to the user, if they're using the partial checkpoint capability. But we do need to be able to resolve the pointers even if they aren't in the variables being checkpointed. I think the solution to this will be adding another parameter to CheckpointAgentBase::dump and CheckpointAgentBase::restore for allocs to search, but not checkpoint.