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

corec: rework internals to avoid pointer alignment issues #204

Merged
merged 32 commits into from
Jan 3, 2025

Conversation

robUx4
Copy link
Contributor

@robUx4 robUx4 commented Jan 3, 2025

void* is fine if we cast to the proper target type.
It's not fully clean as the structure as the array allocations don't take care of the final pointer alignments.

The address sanitizer is happy and the regression tests still pass.

robUx4 added 30 commits January 3, 2025 18:13
Use ARRAYCOUNT when you know the type inside the array.
We can just share the static structure with node.c.
And only reset _Begin/_End once.
Using direct access to the array fields
Just count the offset, to void some pointer arithmetics.
So we are free to use the alignment we want.
And we don't do pointer arithmetics.
So we don't deal with alignment which is correct since
it's pointing to an actual pointer of that type.
It's potentially using less space and needs
less pointer subtractions.
@robUx4 robUx4 merged commit cb01450 into Matroska-Org:master Jan 3, 2025
5 checks passed
@robUx4 robUx4 deleted the alignfux branch January 3, 2025 17:16
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.

1 participant