I was just looking through the samples and I saw malloc and free both in the DHRYSTONE sample:

Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));

I thought OpenAT wouldn’t work with malloc and free. Has Wavecom modified the GCC library so malloc calls adl_memGet and Release? Or is this an example of a bug in the sample that would cause most programs to crash but this benchmark software doesn’t run long enough for anyone to notice that it would crash after a while?

I have a larger question. If I’m porting a significant software base that relies on the standard library very heavily (for example has lots of calls to calloc() and printf()). Instead of modifying the code base I would like to just re-implement these functions to call adl functions. I don’t mean to create header files to just point to different functions because I would have to add the header file to every source file and deal with dependencies and conflicts. I’m talking about reimplementing these functions. Has anyone done anything like this?

I’d probably try to take it one step further and take out rand(), printf("%f") and any other library function known to crash an OpenAT so that my build environment doesn’t allow code calling these functions to compile or link.

printf(“%f”) should be avoided in any case, as it is known to crash in OpenAT. However rand() has never caused me any trouble so far, I have been using it a lot. It would be interesting to know if anybody has ever had any trouble with it…

As for your application, I would recommend that you rename all function like calloc etc. and implement them yourself (by calling adl functions internally).

Best regards,


Maybe it is not necessary to rename the function calls. Normally the compiler fetch only functions from its own library to solve unresolved symbols. If you define the same functions in your project the compiler should take these first.
Attention: If you will replace printf by your own version you must also replace sprintf, vprintf, … because these functions are in the same module :frowning:

Regards, Ralf