-
Notifications
You must be signed in to change notification settings - Fork 522
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
[.NET/CoreVideo] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] Partial Fix for #10470 #15892
Conversation
src/CoreVideo/CVDisplayLink.cs
Outdated
var tempInNow = *inNow; | ||
var tempInOutputTime = *inOutputTime; | ||
var tempFlagsOut = *flagsOut; | ||
var returnValue = func (delegateDisplayLink, ref tempInNow, ref tempInOutputTime, flagsIn, ref tempFlagsOut); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal, but I think you can use System.Runtime.InteropServices.Unsafe.Unsafe.AsRef<T>
here:
so it becomes something like:
var returnValue = func (delegateDisplayLink, ref tempInNow, ref tempInOutputTime, flagsIn, ref tempFlagsOut); | |
var returnValue = func (delegateDisplayLink, ref System.Runtime.CompilerServices.Unsafe.AsRef<CVTimeStamp> (inNow), ...); |
and that way you wouldn't have to create the temporary variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked this over in SharpLab and it looks like a win.
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.
🔥 [PR Build] Build failed 🔥Build failed for the job 'Detect API changes' Pipeline on Agent |
🔥 Unable to find the contents for the comment: D:\a\1\s\change-detection\results\gh-comment.md does not exist :fire Pipeline on Agent |
💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻✅ All tests on macOS Mac Catalina (10.15) passed. Pipeline on Agent |
❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌Failed tests are:
Pipeline on Agent |
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: simulator tests. 🎉 All 223 tests passed 🎉 Tests counts✅ bcl: All 69 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
straightforward