# MKL_malloc

Allocates the aligned memory buffer.

## Syntax

Fortran:

ptr = MKL_MALLOC ( size, alignment )

C:

void* MKL_malloc ( size_t size , int alignment );

## Input Parameters

Name | Type | Description
--- | --- | ---
size | FORTRAN: INTEGER C: size_t | Size of the buffer to be allocated
alignment | FORTRAN: INTEGER C: int | Alignment of the allocated buffer

## Output Parameters

Name | Type | Description
--- | --- | ---
ptr | FORTRAN: POINTER C: void* | Pointer to the allocated buffer

## Description

The function allocates a size-bytes buffer, aligned on the alignment boundary, and returns a pointer to this buffer.

The function returns NULL if size < 1. If alignment is not power of 2, the alignment 32 is used.

See Example “MKL_malloc(), MKL_free(), MKL_MemStat() Usage”.

Parent topic: Memory Functions