-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Update Table.cs #8760
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
base: master
Are you sure you want to change the base?
Update Table.cs #8760
Conversation
|
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. |
|
@aardappel this looks sensible to me but I'm not entirely sure, can you take a look? |
|
Hmm, this seems a bug indeed, wonder why no-one has ever run into it? Why not use https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/sizeof ? |
|
Also on that link:
Apparently unmanaged |
Fix memory alignment issue: calculate correct byte length (element count × element size)
|
@KanouAo can you make a regression test for this? And investigate if sizeof can/should be used instead? |
I think not many people have encountered this problem so far because the bug was only introduced on October 25, 2025, by commit 95053e6. This commit changed the meaning of the parameter Since there were no tests for I created a PR 2036b0b that adds these tests to |
Fix memory alignment issue: calculate correct byte length (element count × element size)
Just add a line : var byteLen = len * System.Runtime.InteropServices.Marshal.SizeOf();
#8759