Avoid Marshal.SizeOf in EventSource (#47521)
* Avoid Marshal.SizeOf in EventSource 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 https://github.com/dotnet/coreclr/pull/19205. * Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs * Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs * Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs
Showing
想要评论请 注册 或 登录