Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

IPP 8.1 i_malloc interface

Michal_B_Intel
Employee
372 Views

Hello,

If I want to replace standard allocation routines with my own using i_malloc interface do I need to specify all of them? For example if I use the pattern for FFT to query the buffer size, allocate memoy using ippsMalloc_8u and then init the FFT using the memory I allocated myself is there a chance that IPP will call for example realloc somewhere inside? Is it enough to just write my own malloc() and free() functions and skip realloc and calloc?

0 Kudos
4 Replies
Chao_Y_Intel
Moderator
372 Views

Hello,
 
There are two different memory allocations with Intel IPP functions: some functions may internally call memory allocation functions. For such function, if you define your own i_malloc interface, IPP functions will internally use your defined memory allocation functions.

There are some interfaces which needs user call malloc/ipp_malloc to allocate one buffer first, then these buffers are used by IPP functions call.  For such API, you still need to externally allocate the memory buffer by your memory allocator.

Regards,
Chao

0 Kudos
Michal_B_Intel
Employee
372 Views

Thanks for your reply.

If I use the API which requires me to allocate memory before calling IPP function is it safe to assume that internally IPP wont reallocate memory?

Michał

0 Kudos
Igor_A_Intel
Employee
372 Views

Hi Michal,

IPP functions don't reallocate anything internally. So it's enough to apply i_malloc mechanism to be sure that there are no any internal hidden calls to any other runtime functions. We have customers that use IPP in kernel mode (non-pic Linux libs are delivered especially for this purpose) - guess this fact proves all words above.

regards, Igor

0 Kudos
Michal_B_Intel
Employee
372 Views

Great, thank you for clarification.

Michał

0 Kudos
Reply