Skip to content

Commit

Permalink
Convert Array.CopySlow to managed (#97202)
Browse files Browse the repository at this point in the history
* Body of CopySlow and setup QCall for CanAssignArrayType

* UnBoxEachElement

* BoxEachElement

* CastCheckEachElement

* Move Unbox_Nullable to RuntimeHelpers
---------

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
  • Loading branch information
huoyaoyuan and AaronRobinsonMSFT committed Jan 26, 2024
1 parent 16cb414 commit ca703a1
Show file tree
Hide file tree
Showing 9 changed files with 337 additions and 521 deletions.
299 changes: 297 additions & 2 deletions src/coreclr/System.Private.CoreLib/src/System/Array.CoreCLR.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ internal static unsafe class CastHelpers
[DebuggerHidden]
[StackTraceHidden]
[DebuggerStepThrough]
private static object? ChkCastAny(void* toTypeHnd, object? obj)
internal static object? ChkCastAny(void* toTypeHnd, object? obj)
{
CastResult result;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ internal static unsafe bool ObjectHasComponentSize(object obj)
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern unsafe object? Box(MethodTable* methodTable, ref byte data);

[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern unsafe void Unbox_Nullable(ref byte destination, MethodTable* toTypeHnd, object? obj);

// Given an object reference, returns its MethodTable*.
//
// WARNING: The caller has to ensure that MethodTable* does not get unloaded. The most robust way
Expand Down
Loading

0 comments on commit ca703a1

Please sign in to comment.