Re: Does the function malloc() uses the real malloc or the wrap one in heapobj_pkg_init_private().

Jan Kiszka jan.kiszka at siemens.com
Tue Apr 7 11:55:25 CEST 2020


On 07.04.20 11:13, 孙世龙 via Xenomai wrote:
> The source code url is
> https://gitlab.denx.de/Xenomai/xenomai/-/blob/v3.1/lib/copperplate/
> heapobj-heapmem.c  line:107
> 
> In the source code listed above, function heapobj_pkg_init_private()  calls
> malloc().
> I hope to know whether it calls the wrapper function or
> the real malloc function which provides by the glibc?
> 
> How could I distinguish a function directs to the wrapper function or
> the real one which provides by the glibc?
> 

(Transparent) wrapping only happens when an object is linked with the 
related options (-Wl,XXX.wrappers). Internal libs are not built like 
that (you can always check the build log), so the original malloc is called.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux



More information about the Xenomai mailing list