Open jdeans289 opened 1 year ago
Some more thoughts on this -
Registering statics is something that the MemoryManager should be responsible for. I think traversing the types and looking for static fields should be implemented as a Visitor. The memory manager should use this visitor to get a list of static members referenced by an allocation, and then check to see if any of them are not registered yet. This might be slow, so maybe the visitor itself should take a reference to the memory manager and do this checking and registration along the way, so that we can prune the traversal.
I want the memory manager and allocinfo classes to track datatypes, but have NO special case code for different types. All of that should be handled elsewhere, like in Visitor classes.
Currently, the Memory Manager and checkpoint algorithms do not correctly handle static member variables of classes.
There is an assumption that all of the memory for an object is in a contiguous region that can be tracked by a single AllocInfo object, and therefore that every "name" under a root alloc info object is within the region specified by alloc.start to alloc.end. This is not true for static member variables, since they do not belong to any particular object.
Problems that need to be solved: