To determine the correct amount of memory to allocate for a single XGameSaveBlob when reading, you should consider the following:
- Size of the Blob Data: The
XGameSaveBlobInfo::sizefield represents the size of the saved data within the blob. This is the primary value you will need to allocate memory for the actual data. - Size of the Blob Structure: You also need to account for the size of the
XGameSaveBlobstructure itself, which includes theXGameSaveBlobInfometadata and the pointer to the data. Therefore, the total memory allocation should be the size of the blob data plus the size of theXGameSaveBlobstructure. - Implementation Considerations: When implementing the function, you can calculate the total memory allocation as follows:
This ensures that you allocate enough memory for both the metadata and the actual saved data.size_t totalSize = sizeof(XGameSaveBlob) + blobInfo.size;
If you find discrepancies in the documentation or header comments, it may be helpful to cross-reference with other parts of the SDK or seek clarification from the documentation team or community forums. However, the approach outlined above should provide a solid basis for your memory allocation needs when reading from a XGameSaveBlob.
References: