Skip to content

Avoid Marshal.SizeOf in EventSource #47521

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

Merged
merged 4 commits into from
Jan 29, 2021

Conversation

MichalStrehovsky
Copy link
Member

We're getting the marshalling size of an enum underlying type - there are not that many of those. I chose not to treat char and bool, but we could (the only other remaining options).

Calling into Marshal.SizeOf increases the risk that EventSource is going call itself recursively - see the comment at the beginning of the method.

This was originally introduced in dotnet/coreclr#19205.

We're getting the marshalling size of an enum underlying type - there are not that many of those. I chose not to treat `char` and `bool`, but we could (the only other remaining options).

Calling into `Marshal.SizeOf` increases the risk that `EventSource` is going call itself recursively - see the comment at the beginning of the method.

This was originally introduced in dotnet/coreclr#19205.
Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stephentoub stephentoub merged commit 01a36b5 into dotnet:master Jan 29, 2021
@MichalStrehovsky MichalStrehovsky deleted the MichalStrehovsky-patch-1 branch January 29, 2021 14:43
@ghost ghost locked as resolved and limited conversation to collaborators Feb 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants