_lwmem_alloc vs _mem_alloc

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

_lwmem_alloc vs _mem_alloc

527 Views
netra
Contributor IV

what is the situation for using _mem_alloc and _lwmem_alloc???

0 Kudos
1 Reply

278 Views
JuroV
NXP Employee
NXP Employee

Hello, I do not know what you need to know exactly. :smileyhappy:

For usual application developers, both return address of allocated memory space in the heap. The difference is in how they work internally.

lwmem or mem stands for memory manager used: you can use either mem or lwmem. They are compiled-in during PSP build process. In the user_config.h you can choose which memory manager you want to use. Then you get also exported header with macros redefining your _mem_alloc to _mem_alloc (the same call name if the memory manager is mem) or _mem_alloc to _lwmem_alloc (the translation to lwmem manager call in the case the memory manager is lwmem). That's why we recommend to use _mem_alloc in your application and to choose memory manager in user_config.h

0 Kudos