Skip to content
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

Avoid misaligned read when loading SGM files #5692

Merged
merged 2 commits into from Jan 7, 2024

Conversation

Web-eWorks
Copy link
Member

Amend the Scenegraph serialization interface to more correctly handle the unaligned reads required by the SGM data structure layout. While the unaligned reads are in practice not an issue, this provides some future proofing against future compiler "improvements" (read: backwards compatibility breakages) and means the code is more portable to architectures like ARM64 which have a hardware requirement of aligned reads.

Closes #5687.

- Use std::memcpy instead of reinterpret_cast as it's almost as fast while internally handling unaligned reads
@Web-eWorks Web-eWorks merged commit ea1eb41 into pioneerspacesim:master Jan 7, 2024
5 checks passed
@Web-eWorks Web-eWorks deleted the sgm-unaligned-read branch January 7, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scenegraph/Serializer.h: load of misaligned address
2 participants