MCPcopy Create free account
hub / github.com/crazytuzi/UnrealCSharp / NewArray

Method NewArray

Script/Interop/Bridge/ArrayBridge.cs:8–26  ·  view source on GitHub ↗
(byte* InFullName, int InLength)

Source from the content-addressed store, hash-verified

6public static unsafe class ArrayBridge
7{
8 [UnmanagedCallersOnly]
9 public static nint NewArray(byte* InFullName, int InLength)
10 {
11 if (InFullName != null && InLength > 0)
12 {
13 var FullName = Marshal.PtrToStringUTF8((nint)InFullName)!;
14
15 var Type = TypeBridge.GetTypeImplementation(FullName);
16
17 if (Type != null)
18 {
19 var Handle = GCHandle.Alloc(Array.CreateInstance(Type, InLength), GCHandleType.Pinned);
20
21 return HandleData.AddEntity(Handle);
22 }
23 }
24
25 return 0;
26 }
27
28 [UnmanagedCallersOnly]
29 public static nint ArrayGet(nint InHandle, int InIndex)

Callers

nothing calls this directly

Calls 3

AllocMethod · 0.80
AddEntityMethod · 0.80
GetTypeImplementationMethod · 0.45

Tested by

no test coverage detected