Attempts to allocate (unmanaged) memory from MPI. This memory must be manually freed with a call to MPI_Free_mem(IntPtr). This routine is used automatically by the UnmanagedMemoryStream to allocate memory when serializing or de-serializing objects within MPI.NET.

Namespace:  MPI
Assembly:  MPI (in MPI.dll)
Version: (


public static int MPI_Alloc_mem(
	IntPtr size,
	int info,
	out IntPtr baseptr
Visual Basic (Declaration)
Public Shared Function MPI_Alloc_mem ( _
	size As IntPtr, _
	info As Integer, _
	<OutAttribute> ByRef baseptr As IntPtr _
) As Integer
Visual C++
static int MPI_Alloc_mem(
	IntPtr size, 
	int info, 
	[OutAttribute] IntPtr% baseptr


Type: System..::.IntPtr
The number of bytes to allocate.
Type: System..::.Int32
Provides extra information to the MPI implementation that may help it allocate memory for a specific reason or from a specific memory pool.
Type: System..::.IntPtr %
Will receive a pointer to the newly-allocated memory.

Return Value

MPI_SUCCESS if memory is successfully allocated, MPI_ERR_NO_MEM if no memory is available.

See Also