If possible, could you provide a test case that reproduces this and we'll investigate.
Hi Simon
I didn't spot this before but I just tried to use my code at the top of this thread, and I think there is now a problem with malloc() as Sean says, and it may have been introduced with the compiler changes?
You can test it with this code:
#include "mbed.h"
int main() {
printf("Hello world\n");
// perform free memory check
int blockSize = 256;
int i = 1;
printf("Checking memory with blocksize %d char ...\n", blockSize);
while (true) {
char *p = (char *) malloc(i * blockSize);
printf("%d\n", i);
if (p == NULL)
break;
free(p);
++i;
}
printf("Ok for %d char\n", (i - 1) * blockSize);
}
It prints out a series of integers but never gets to the final printf.
Could you look into this please? If I don't see a response here, I'll cross post under bugs.
Thanks
Daniel
Besides calling malloc/free repeatedly as in the code below, is there any way to check how much RAM is available whilst running?
Also, it is possible to work out from the compilation how much RAM is taken up by the program (is this as simple as the bin size)?