google / flatbuffers

FlatBuffers: Memory Efficient Serialization Library
https://flatbuffers.dev/
Apache License 2.0
23.16k stars 3.23k forks source link

use ALIGN for Push::alignment in struct types #8398

Open bkietz opened 1 week ago

bkietz commented 1 week ago

This PR adds an override of the default Push::alignment(), which is incorrectly 1 for structs because they are byte arrays and this doesn't accurately reflect the type's alignment requirements.

fixes #8150

google-cla[bot] commented 1 week ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

bkietz commented 1 week ago

@evgenyx00 @tustvold

bkietz commented 1 week ago

I was not sure where to add such a test, but I'd be happy to. I opened https://github.com/apache/arrow-rs/pull/6426 since that seemed like a good way to check for regressions (I didn't see any). @aardappel @CasperN any recommendations?

aardappel commented 1 week ago

@bkietz yes we generally should have tests :) Not too familiar with the Rust tests though, have a look.