diff --git a/xml/System.Runtime.InteropServices/Marshal.xml b/xml/System.Runtime.InteropServices/Marshal.xml index 0bdb28fcf2c..a8ac4b0506e 100644 --- a/xml/System.Runtime.InteropServices/Marshal.xml +++ b/xml/System.Runtime.InteropServices/Marshal.xml @@ -303,6 +303,9 @@ [!IMPORTANT] +> This native memory allocator is a legacy API that should be used exclusively when called for by specific Win32 APIs on the Windows platform. When targeting .NET 6 or later, use the class on all platforms to allocate native memory. When targeting .NET 6 or earlier, use on all platforms to allocate native memory. + is one of two memory allocation methods in the class. ( is the other.) This method exposes the Win32 [LocalAlloc](https://go.microsoft.com/fwlink/?LinkId=148628) function from Kernel32.dll. When calls `LocalAlloc`, it passes a `LMEM_FIXED` flag, which causes the allocated memory to be locked in place. Also, the allocated memory is not zero-filled. @@ -383,6 +386,9 @@ [!IMPORTANT] +> This native memory allocator is a legacy API that should be used exclusively when called for by specific Win32 APIs on the Windows platform. When targeting .NET 6 or later, use the class on all platforms to allocate native memory. When targeting .NET 6 or earlier, use on all platforms to allocate native memory. + is one of two memory allocation methods in the class. ( is the other.) This method exposes the Win32 [LocalAlloc](https://go.microsoft.com/fwlink/?LinkID=148628) function from Kernel32.dll. When calls `LocalAlloc`, it passes a `LMEM_FIXED` flag, which causes the allocated memory to be locked in place. Also, the allocated memory is not zero-filled. @@ -2656,6 +2662,9 @@ [!IMPORTANT] +> This native memory allocator is a legacy API that should be used exclusively when called for by specific Win32 APIs on the Windows platform. When targeting .NET 6 or later, use the class on all platforms to allocate native memory. When targeting .NET 6 or earlier, use on all platforms to allocate native memory. + You can use to free any memory from the global heap allocated by , , or any equivalent unmanaged API method. If the `hglobal` parameter is the method does nothing. exposes the [LocalFree](https://go.microsoft.com/fwlink/?LinkId=148640) function from Kernel32.DLL, which frees all bytes so that you can no longer use the memory pointed to by `hglobal`. @@ -9569,6 +9578,9 @@ On .NET 6 and later versions, this method is functionally equivalent to [!IMPORTANT] +> This native memory allocator is a legacy API that should be used exclusively when called for by specific Win32 APIs on the Windows platform. When targeting .NET 6 or later, use the class on all platforms to allocate native memory. When targeting .NET 6 or earlier, use on all platforms to allocate native memory. + is one of two memory reallocation API methods in the class. ( is the other.) This method exposes the Win32 [GlobalReAlloc](https://go.microsoft.com/fwlink/?LinkId=148780) function from Kernel32.dll. The returned pointer can differ from the original. If it is different, the contents of the original memory block have been copied to the new block, and the original memory block has been freed.