-
Notifications
You must be signed in to change notification settings - Fork 106
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
Convert activation and error info delegates to function pointers #1018
Conversation
Avoids overhead of creating the marshaled delegates
|
||
internal delegate int SetRestrictedErrorInfo(IntPtr pRestrictedErrorInfo); | ||
private static SetRestrictedErrorInfo setRestrictedErrorInfo; | ||
private static readonly bool initialized = Initialize(); |
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.
This pattern avoids precise static constructor that was here before. The precise static constructor adds overhead to all static methods in the type. The overhead was visible on the ThrowExceptionForHR
method.
@manodasanW PTLA |
@@ -4,6 +4,7 @@ | |||
namespace WinRT.Interop | |||
{ | |||
[Guid("11D3B13A-180E-4789-A8BE-7712882893E6")] | |||
[StructLayout(LayoutKind.Sequential)] |
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.
This is a convenient way to silence unused field warnings in structs like this.
Thanks @jkotas for this change. |
/azp run |
No pipelines are associated with this pull request. |
/azp run |
No pipelines are associated with this pull request. |
Avoids overhead of creating the marshaled delegates