[CoreMidi] Make P/Invokes have blittable signatures. by rolfbjarne · Pull Request #19724 · dotnet/macios (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation39 Commits6 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
This turned into a rather involved exercise, because the
MidiThruConnectionParamsStruct struct had several array fields that needed
marshalling to work.
The changes include:
- Unwrap the array fields with MarshalAs attributes to be individual fields
instead. - Write a number of tests to ensure the changes work.
- Fix an overflow issue found by the tests for the Controls array if trying to
set to an array with more than 65535 elements. - Fix an overflow issue found by the tests for the Maps array if trying to set
to an array with more than 65535 elements. - Fix an issue found by the tests where we wouldn't deserialize the Maps array
correctly from a byte array / NSData if the Maps array had more than 1
element. - Fix a consistency issue found in the tests where deserializing a serialized
structure doesn't yield the same result.- In particular this happens with the ChannelMap property: behavior has
changed a little bit where setting the ChannelMap to an array with fewer
than 16 elements (including a null array) will not return the same array
anymore, but instead an array with 16 elements, where the extra elements
are all 0. I've also made the ChannelMap property non-nullable, since
the nullability state isn't serializable into the underlying struct.
- In particular this happens with the ChannelMap property: behavior has
Contributes towards #15684.
This turned into a rather involved exercise, because the MidiThruConnectionParamsStruct struct had several array fields that needed marshalling to work.
The changes include:
- Unwrap the array fields with MarshalAs attributes to be individual fields instead.
- Write a number of tests to ensure the changes work.
- Fix an overflow issue found by the tests for the Controls array if trying to set to an array with more than 65535 elements.
- Fix an overflow issue found by the tests for the Maps array if trying to set to an array with more than 65535 elements.
- Fix an issue found by the tests where we wouldn't deserialize the Maps array correctly from a byte array / NSData if the Maps array had more than 1 element.
- Fix a consistency issue found in the tests where deserializing a serialized
structure doesn't yield the same result.
- In particular this happens with the ChannelMap property: behavior has changed a little bit where setting the ChannelMap to an array with fewer than 16 elements (including a null array) will not return the same array anymore, but instead an array with 16 elements, where the extra elements are all 0. I've also made the ChannelMap property non-nullable, since the nullability state isn't serializable into the underlying struct.
Contributes towards dotnet#15684.
⚠️ Your code has been reformatted. ⚠️
If this is not desired, add the actions-disable-autoformat
label, and revert the reformatting commit.
If files unrelated to your change were modified, try reverting the reformatting commit + merging with the target branch (and push those changes).
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💻 [CI Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻
✅ All tests on macOS M1 - Mac Ventura (13.0) passed.
Pipeline on Agent
Hash: [PR build]
💻 [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻
✅ All tests on macOS M1 - Mac Big Sur (11.5) passed.
Pipeline on Agent
Hash: [PR build]
This comment has been minimized.
✅ API diff for current PR / commit
Legacy Xamarin (No breaking changes)
iOS(no change detected)tvOS(no change detected)watchOS(no change detected)macOS(no change detected) NET (empty diffs)iOS: (empty diff detected)tvOS: (empty diff detected)MacCatalyst: (empty diff detected)macOS: (empty diff detected)
✅ API diff vs stable
Legacy Xamarin (No breaking changes)
- iOS: vsdrops gist (No breaking changes)
- tvOS: vsdrops gist (No breaking changes)
- watchOS: vsdrops gist (No breaking changes)
- macOS: vsdrops gist (No breaking changes) .NET (No breaking changes)
- iOS: vsdrops gist (No breaking changes)
- tvOS: vsdrops gist (No breaking changes)
- MacCatalyst: vsdrops gist (No breaking changes)
- macOS: vsdrops gist (No breaking changes)
- Microsoft.iOS vs Microsoft.MacCatalyst: vsdrops gist Legacy Xamarin (stable) vs .NET
- iOS: vsdrops gist
- tvOS: vsdrops gist
- macOS: vsdrops gist
ℹ️ Generator diff
Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)
Pipeline on Agent
Hash: dbd2b7550b0f8ee9e8af978d8030010f8b2c8e69 [PR build]
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still haunting us in 2024 😅, LGTM amazing job Rolf!
rolfbjarne deleted the coremidi-blittable-midithruconnectionparams branch