Resizes a block of memory previously allocated with Marshal.AllocCoTaskMem(int).
- pv
- A pointer to memory allocated with Marshal.AllocCoTaskMem(int).
- cb
- The new size of the allocated block.
An integer representing the address of the reallocated block of memory. This memory must be released with Marshal.FreeCoTaskMem(IntPtr).
Marshal.ReAllocCoTaskMem(IntPtr, int) is one of two memory reallocation methods in the System.Runtime.InteropServices.Marshal class. (Marshal.ReAllocHGlobal(IntPtr, IntPtr) is the other.) The beginning of the reallocated memory content is the same as the original content; however, the entire memory block can be in a different location. This method exposes the COM tp://go.microsoft.com/fwlink/?LinkId=148778 function, which is referred to as the COM task memory allocator.