X Tutup
Skip to content

Avoid misaligned read when loading SGM files#5692

Merged
sturnclaw merged 2 commits intopioneerspacesim:masterfrom
sturnclaw:sgm-unaligned-read
Jan 7, 2024
Merged

Avoid misaligned read when loading SGM files#5692
sturnclaw merged 2 commits intopioneerspacesim:masterfrom
sturnclaw:sgm-unaligned-read

Conversation

@sturnclaw
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
@sturnclaw sturnclaw merged commit ea1eb41 into pioneerspacesim:master Jan 7, 2024
@sturnclaw sturnclaw 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

X Tutup