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.