Spanize interop in System.Net.NetworkInformation#35098
Conversation
|
Tagging subscribers to this area: @dotnet/ncl |
|
Depends on #35078 |
...aries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemTcpConnection.cs
Outdated
Show resolved
Hide resolved
|
Which bits make it faster and which safer? It looks like it's adding unsafe modifiers (for the fixed) which makes is counter intuitive to be safer from a casual perspective. |
The faster part is e.g. not using array marshaling and PtrToStructure, and using sizeof instead of Marshal.SizeOf. The safer part is using span slicing instead of math on pointers, with the spans being bounds checked. |
|
Faster and safer
Faster and safer