-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/metadata #2
base: main
Are you sure you want to change the base?
Conversation
This looks good so far. Still need to add the rest of the meta data support including validation of data |
In testing this does not appear to be working. In the watch window the addresses of the metadata are nearly 2MB away from the addresses of the working variables
persistInternalRestore.c
Outdated
if(Persistence->Internal.WorkingVariableInfo[i].pMetadata->variableSize == Persistence->Internal.WorkingVariableInfo[i].sizeofWorkingVariable | ||
&&Persistence->Internal.WorkingVariableInfo[i+1].pMetadata != 0){ | ||
*(BOOL*)Persistence->IN.pDataValid = 0; | ||
return (UINT)PERSIST_ERR_DATAMOVED_CHANGED; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change, it should be removed for this PR and revisited later.
DTGetTime_typ getTime; | ||
|
||
getTime.enable = 0; | ||
DTGetTime(&getTime); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look like it is being used. Should be either removed or be used.
What:
Adds memory allocation for a metadata struct corresponding to each variable we are saving in permanent memory.
Why:
This is being done in conjunction with an updated configuration system. The hope is to eventually store metadata which can allow us to determine if the data is invalid without needing to have a separate persistent dataValid array.
Next steps:
The intention of this system is to provide the persistent memory with a way to verify its validity. The metadata struct has a
pSelf
member, which is intended to be its address in memory. By checking that this is true for all members in the persistent memory, and that the following metadata object is the expected distance (sizeof(metadata) + metadata.sizeofVar) we can verify that the data in permmemory has been properly initialized. Once this step has been taken, we can verify that the current sizes of the variables match what we expect them to with the permanent memory, and if needed write a function to re-define those pointers to restore as much valid data as possible from the persistent memory.