Marshal.FreeCoTaskMem(IntPtr) 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.
Frees a block of memory allocated by the unmanaged COM task memory allocator.
public:
static void FreeCoTaskMem(IntPtr ptr);
[System.Security.SecurityCritical]
public static void FreeCoTaskMem (IntPtr ptr);
public static void FreeCoTaskMem (IntPtr ptr);
[<System.Security.SecurityCritical>]
static member FreeCoTaskMem : nativeint -> unit
static member FreeCoTaskMem : nativeint -> unit
Public Shared Sub FreeCoTaskMem (ptr As IntPtr)
Parameters
- ptr
-
IntPtr
nativeint
The address of the memory to be freed.
- Attributes
Remarks
You can use FreeCoTaskMem to free any memory allocated by AllocCoTaskMem, ReAllocCoTaskMem, or any equivalent unmanaged method. If the ptr
parameter is IntPtr.Zero
, the method does nothing.
FreeCoTaskMem exposes the COM CoTaskMemFree function, which frees all bytes so that you can no longer use the memory that the ptr
parameter points to.
In addition to FreeCoTaskMem, the Marshal class provides two other memory-deallocation methods: DestroyStructure and FreeHGlobal.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기