Malloc

Allocates memory aligned to 32-byte boundary.

Syntax

Ipp8u* ippsMalloc_8u(int len);

Ipp16u* ippsMalloc_16u(int len);

Ipp32u* ippsMalloc_32u(int len);

Ipp8s* ippsMalloc_8s(int len);

Ipp16s* ippsMalloc_16s(int len);

Ipp32s* ippsMalloc_32s(int len);

Ipp64s* ippsMalloc_64s(int len);

Ipp32f* ippsMalloc_32f(int len);

Ipp64f* ippsMalloc_64f(int len);

Ipp8sc* ippsMalloc_8sc(int len);

Ipp16sc* ippsMalloc_16sc(int len);

Ipp32sc* ippsMalloc_32sc(int len);

Ipp64sc* ippsMalloc_64sc(int len);

Ipp32fc* ippsMalloc_32fc(int len);

Ipp64fc* ippsMalloc_64fc(int len);

Parameters

len

Number of elements to allocate.

Description

The function ippsMalloc is declared in the ipps.h file. This function allocates memory block aligned to a 32-byte boundary for elements of different data types.

The example below shows how to use the function ippsMalloc_8u.

Using the Function ippsMalloc

void func_malloc(void)
{    
    Ipp8u* pBuf = ippsMalloc_8u(8*sizeof(Ipp8u));
    if(NULL == pBuf)
      // not enough memory



    ippsFree(pBuf);
}



Return Values

The return value of ippsMalloc is a pointer to an aligned memory block. If no memory is available in the system, then the NULL value is returned. To free this block, use the function ippsFree.


Submit feedback on this help topic

Copyright © 2000 - 2010, Intel Corporation. All rights reserved.