Unified Memory Management

The IntelĀ® MPI Library provides a way to replace the memory management subsystem by a user-defined package. You may optionally set the following function pointers:

These pointers also affect the C++ new and delete operators.

The respective standard C library functions are used by default.

The following contrived source code snippet illustrates the usage of the unified memory subsystem:

#include <i_malloc.h>
#include <my_malloc.h>
int main( int argc, int argv )
{
// override normal pointers
i_malloc = my_malloc;
i_calloc = my_calloc;
i_realloc = my_realloc;
i_free = my_free;
#ifdef _WIN32
// also override pointers used by DLLs
i_malloc_dll = my_malloc;
i_calloc_dll = my_calloc;
i_realloc_dll = my_realloc;
i_free_dll = my_free;
#endif
// now start using Intel(R) libraries
}