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

Align memory to pointer size. #175

Merged
merged 1 commit into from
Oct 5, 2023
Merged

Conversation

GorogPeter
Copy link
Contributor

Some architectures like ARM32 doesn't support non-aligned memory operations thus I aligned the memory.

Without it Walrus crashes on ARM32.

@zherczeg
Copy link
Collaborator

A bit more background: ARM32 just partly support unaligned access. For example all floats/doubles must be 4 byte aligned, and some integer operations such as load/store multiple must be as well. For example, when a 64 bit integer is loaded with load multiple instruction, it must be 4 byte aligned. The byte code is not aligned, but aligning it to pointer size fixes this. The other alternative is use attribute packed on the ByteCode structure. That is just a single line change, but the generated code is less efficient. What do you think?

Copy link
Collaborator

@clover2123 clover2123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@clover2123 clover2123 merged commit 14708b2 into Samsung:interp Oct 5, 2023
@GorogPeter GorogPeter deleted the alignMemory branch November 2, 2023 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants