Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AllocateArray< T >()

static T[] System.GC.AllocateArray< T > ( int length,
bool pinned = false )
inlinestatic

Definition at line 410 of file GC.cs.

411 {
412 GC_ALLOC_FLAGS flags = GC_ALLOC_FLAGS.GC_ALLOC_NO_FLAGS;
413 if (pinned)
414 {
415 if (RuntimeHelpers.IsReferenceOrContainsReferences<T>())
416 {
417 ThrowHelper.ThrowInvalidTypeWithPointersNotSupported(typeof(T));
418 }
419 flags = GC_ALLOC_FLAGS.GC_ALLOC_PINNED_OBJECT_HEAP;
420 }
421 return Unsafe.As<T[]>(AllocateNewArray(typeof(T[]).TypeHandle.Value, length, flags));
422 }
static Array AllocateNewArray(IntPtr typeHandle, int length, GC_ALLOC_FLAGS flags)
GC_ALLOC_FLAGS
Definition GC.cs:10

References System.GC.AllocateNewArray(), System.length, and System.ThrowHelper.ThrowInvalidTypeWithPointersNotSupported().