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

ogt_vox: add type-based memory alignment within the internal sub allocator #63

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

jpaver
Copy link
Owner

@jpaver jpaver commented Oct 24, 2023

  • attempted fix for Crashes due to unaligned memory access #62.
  • we now use a new _vox_suballoc_array type that internally aligns base offset to the size of the type by default (in cases where alignment matters, I'd expect the struct to be padded to the natural alignment and for all members to have appropriate alignment padding for them too)
  • this still relies upon a reasonable alignment from _vox_malloc, which should either be guaranteed to be 8 or 16 in most 64-bit platforms

@mgerhardy, PTAL and confirm this fixes your ASAN testing issue. Thanks!

…cator.

- attempted fix for #62.
- we now use a new _vox_suballoc_array type that internally aligns base offset to the size of the type by default (in cases where alignment matters, I'd expect the struct to be padded to the natural alignment and for all members to have appropriate alignment padding for them too)
- this still relies upon a reasonable alignment from _vox_malloc, which should either be guaranteed to be 8 or 16 in most 64-bit platforms

@mgerhardy, PTAL and confirm this fixes your ASAN testing issue. Thanks!
@jpaver jpaver requested a review from mgerhardy October 24, 2023 00:21
mgerhardy added a commit to vengi-voxel/vengi that referenced this pull request Oct 30, 2023
@mgerhardy
Copy link
Collaborator

Thanks a lot for the patch - applied it to vengi - if this pipeline run is successful, this can get merged.

Copy link
Collaborator

@mgerhardy mgerhardy left a comment

Choose a reason for hiding this comment

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

fixes the problem for me

@jpaver jpaver merged commit a45c00f into master Nov 16, 2023
3 checks passed
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.

None yet

2 participants