GC.AllocateArray<T>(Int32, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Allocates an array.
public static T[] AllocateArray<T> (int length, bool pinned = false);
static member AllocateArray : int * bool -> 'T[]
Public Shared Function AllocateArray(Of T) (length As Integer, Optional pinned As Boolean = false) As T()
Type Parameters
- T
Specifies the type of the array element.
Parameters
- length
- Int32
Specifies the length of the array.
- pinned
- Boolean
Specifies whether the allocated array must be pinned.
Returns
T[]
An array object.
Remarks
In .NET 7 and earlier versions: If pinned is set to true
, T
must not be a reference type or a type that contains object references.
Applies to
GitHub पर हमारे साथ सहयोग करें
इस सामग्री का स्रोत GitHub पर पाया जा सकता है, जहाँ आप समस्याएँ बना और समीक्षा भी कर सकते हैं और अनुरोध खींच सकते हैं. अधिक जानकारी के लिए, हमारे योगदानकर्ता गाइड देखें.