Conversation
| // This field should be the first field in Array as the runtime/compilers depend on it | ||
| private int _numComponents; | ||
| #pragma warning restore | ||
| internal uint RawLength; // Array._numComponents padded to IntPtr |
There was a problem hiding this comment.
This should follow dotnet/runtime naming conventions for fields.
I do not see a problem with this performance wise. However, I expect that there is going to be a long tail of places that are not prepared to handle fields on array type. Some of them may be outside dotnet/runtime. There may be more straightforward (less breaking) ways to get rid of RawArrayData. For example, call |
|
Tagging subscribers to this area: @mangod9 |
|
This pull request has been automatically marked |
|
This pull request will now be closed since it had been marked |
Removes RawArrayData and makes Array reflect the actual runtime layout instead.
Makes code a bit safer by removing
Unsafe.Asusages with invalid types.cc @EgorBo @tannergooding I ended up doing this after the discussion on Discord
cc @jkotas There was one CoreCLR assert here due to array MT creation not setting the field count, I made it set it here in debug to avoid that and any perf impact in release, is that okay to do?