Marshal.DestroyStructure 메서드

정의

오버로드

Name Description
DestroyStructure(IntPtr, Type)
사용되지 않음.

지정된 관리되지 않는 메모리 블록이 가리키는 모든 하위 구조를 해제합니다.

DestroyStructure<T>(IntPtr)

지정된 관리되지 않는 메모리 블록이 가리키는 지정된 형식의 모든 하위 구조를 해제합니다.

DestroyStructure(IntPtr, Type)

Source:
Marshal.CoreCLR.cs
Source:
Marshal.CoreCLR.cs
Source:
Marshal.cs
Source:
Marshal.cs
Source:
Marshal.CoreCLR.cs

주의

DestroyStructure(IntPtr, Type) may be unavailable in future releases. Instead, use DestroyStructure<T>(IntPtr). For more info, go to http://go.microsoft.com/fwlink/?LinkID=296520

지정된 관리되지 않는 메모리 블록이 가리키는 모든 하위 구조를 해제합니다.

public:
 static void DestroyStructure(IntPtr ptr, Type ^ structuretype);
[System.Obsolete("DestroyStructure(IntPtr, Type) may be unavailable in future releases. Instead, use DestroyStructure<T>(IntPtr). For more info, go to http://go.microsoft.com/fwlink/?LinkID=296520")]
[System.Security.SecurityCritical]
public static void DestroyStructure(IntPtr ptr, Type structuretype);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available. Use the DestroyStructure<T> overload instead.")]
public static void DestroyStructure(IntPtr ptr, Type structuretype);
public static void DestroyStructure(IntPtr ptr, Type structuretype);
[System.Security.SecurityCritical]
public static void DestroyStructure(IntPtr ptr, Type structuretype);
[System.Runtime.InteropServices.ComVisible(true)]
public static void DestroyStructure(IntPtr ptr, Type structuretype);
[System.Security.SecurityCritical]
[System.Runtime.InteropServices.ComVisible(true)]
public static void DestroyStructure(IntPtr ptr, Type structuretype);
[<System.Obsolete("DestroyStructure(IntPtr, Type) may be unavailable in future releases. Instead, use DestroyStructure<T>(IntPtr). For more info, go to http://go.microsoft.com/fwlink/?LinkID=296520")>]
[<System.Security.SecurityCritical>]
static member DestroyStructure : nativeint * Type -> unit
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available. Use the DestroyStructure<T> overload instead.")>]
static member DestroyStructure : nativeint * Type -> unit
static member DestroyStructure : nativeint * Type -> unit
[<System.Security.SecurityCritical>]
static member DestroyStructure : nativeint * Type -> unit
[<System.Runtime.InteropServices.ComVisible(true)>]
static member DestroyStructure : nativeint * Type -> unit
[<System.Security.SecurityCritical>]
[<System.Runtime.InteropServices.ComVisible(true)>]
static member DestroyStructure : nativeint * Type -> unit
Public Shared Sub DestroyStructure (ptr As IntPtr, structuretype As Type)

매개 변수

ptr
IntPtr

nativeint

관리되지 않는 메모리 블록에 대한 포인터입니다.

structuretype
Type

형식이 지정된 클래스의 형식입니다. 매개 변수에서 버퍼 ptr 를 삭제하는 데 필요한 레이아웃 정보를 제공합니다.

특성

예외

structuretype 에는 자동 레이아웃이 있습니다. 대신 순차적 또는 명시적 사용을 사용합니다.

설명

이 메서드를 사용하여 관리되지 않는 구조체의 참조 형식 필드(예: 문자열)를 해제할 수 있습니다. 필드와 달리 구조체는 값 형식 또는 참조 형식일 수 있습니다. 값 형식 필드(모든 blittable)를 포함하는 값 형식 구조에는 메모리를 해제해야 하는 참조가 없습니다. 이 메서드는 Marshal.StructureToPtr 구조체에서 차지하는 메모리를 다시 사용할 때 메모리 누수 방지를 위해 이 메서드를 사용합니다.

DestroyStructure 는 COM SysFreeString 함수를 호출하여 할당된 문자열을 해제합니다.

또한 DestroyStructure클래스는 Marshal 두 가지 다른 메모리 할당 취소 메서드를 제공합니다. FreeCoTaskMemFreeHGlobal

추가 정보

적용 대상

DestroyStructure<T>(IntPtr)

Source:
Marshal.cs
Source:
Marshal.cs
Source:
Marshal.cs
Source:
Marshal.cs
Source:
Marshal.cs

지정된 관리되지 않는 메모리 블록이 가리키는 지정된 형식의 모든 하위 구조를 해제합니다.

public:
generic <typename T>
 static void DestroyStructure(IntPtr ptr);
[System.Security.SecurityCritical]
public static void DestroyStructure<T>(IntPtr ptr);
public static void DestroyStructure<T>(IntPtr ptr);
[<System.Security.SecurityCritical>]
static member DestroyStructure : nativeint -> unit
static member DestroyStructure : nativeint -> unit
Public Shared Sub DestroyStructure(Of T) (ptr As IntPtr)

형식 매개 변수

T

형식이 지정된 구조체의 형식입니다. 매개 변수에서 버퍼 ptr 를 삭제하는 데 필요한 레이아웃 정보를 제공합니다.

매개 변수

ptr
IntPtr

nativeint

관리되지 않는 메모리 블록에 대한 포인터입니다.

특성

예외

T 에는 자동 레이아웃이 있습니다. 대신 순차적 또는 명시적 사용을 사용합니다.

설명

이 메서드를 사용하여 관리되지 않는 구조체의 문자열과 같은 참조 형식 필드를 해제할 수 있습니다. 필드와 달리 구조체는 값 형식 또는 참조 형식일 수 있습니다. 값 형식 필드(모든 blittable)를 포함하는 값 형식 구조에는 메모리를 해제해야 하는 참조가 없습니다. 이 메서드는 Marshal.StructureToPtr 구조체에서 차지하는 메모리를 다시 사용할 때 메모리 누수 방지를 위해 이 메서드를 사용합니다.

DestroyStructure 는 COM SysFreeString 함수를 호출하여 할당된 문자열을 해제합니다.

적용 대상