Marshal.ReAllocCoTaskMem(IntPtr, Int32) 方法

定义

调整之前用 AllocCoTaskMem(Int32) 分配的内存块的大小。

public:
 static IntPtr ReAllocCoTaskMem(IntPtr pv, int cb);
[System.Security.SecurityCritical]
public static IntPtr ReAllocCoTaskMem (IntPtr pv, int cb);
public static IntPtr ReAllocCoTaskMem (IntPtr pv, int cb);
[<System.Security.SecurityCritical>]
static member ReAllocCoTaskMem : nativeint * int -> nativeint
static member ReAllocCoTaskMem : nativeint * int -> nativeint
Public Shared Function ReAllocCoTaskMem (pv As IntPtr, cb As Integer) As IntPtr

参数

pv
IntPtr

nativeint

指向用 AllocCoTaskMem(Int32) 分配的内存的指针。

cb
Int32

已分配块的新大小。

返回

IntPtr

nativeint

一个整数,表示重新分配的内存块的地址。 必须使用 FreeCoTaskMem(IntPtr) 释放该内存。

属性

例外

没有足够的内存来满足该请求。

注解

ReAllocCoTaskMem 是类中两种内存重新分配方法之 Marshal 一。 ReAllocHGlobal (是另一个.) 重新分配的内存内容的开头与原始内容相同;但是,整个内存块可以位于不同的位置。 此方法公开 COM CoTaskMemRealloc 函数,该函数称为 COM 任务内存分配器。

适用于

另请参阅