AnsweredAssumed Answered

Replacing default memory allocator

Question asked by MichalRzechonek on Sep 13, 2010
Latest reply on Sep 13, 2010 by CraigG

I'd like to replace malloc/free  functions with my own implementation, but I cannot find their  definitions in libc sources included with VisualDSP toolset.

 

Is there any way to do that? If so, how?

 

It seems malloc() definition for Blackfin CPUs is not provided (even if it seems to be in case of 211xx and TS). By the way, anyone knows what does #pragma file_attr("libFunc=malloc") mean?

 

I need to replace system-wide allocator, because the default one seems to do UnscheduledRegion locking, which blows big time in a (supposedly) real-time OS.

 

I don't really need the actual source code, detailed description of the libc interface would be enough. For one, I need to know how malloc() determines which heap it use. I've already figured out that heaps are defined in generated _heaptab.c file, so initialising and using TLSF allocator with these would be easy... if I knew where to plug it in.

Outcomes