Hi,

 

I found that malloc/free functions have been implemented in at least three different libraries: cxx, mini_c and libc. I assume cxx is used for genode base and core implementations, mini_c for demos and libc for porting. However, I am not able to use any of them in my own application. When using malloc defined in mini_c or libc, I got a compiler error  “ reference to ‘size_t’ is ambiguous”.  It looks like both stdlib.h in mini_c (or libc) directory and stdint.h in base directory have defined “size_t” type. And I cannot get rid of the use of stdint.h as it has been included in many genode base and core files.  

 

On the other hand, if I wanted to use the malloc in cxx by putting “cxx” into LIB in my application’s target.mk,  malloc cannot be recognized by the compiler.   To solve this problem, I currently have to define my own malloc/free by copying the implementation from cxx and it works. However,  I really wonder which malloc/free defined in genode should I use and how? By the way, the implementation of heap()->alloc() is thread-safe, right?

 

Thanks.

Chen