Javier Almansa Sobrino wrote:
The problem is I can't understand the malfuncion of malloc... :-S

Usually malloc() get nuts when you free() a wrong pointer, or you overwrite some bytes just around an allocated area: depending of the implementation of malloc, bytes around the malloc'ed area hold information for malloc() itself (I dunno for avr-libc however). IMHO you should dig more to find your bug, it may not be related directly to malloc(), for instance you may overwrite some area of RAM and, actually, this area holds some data for malloc(). This overwriting may occur during interrupts, or whatever code is activated outside the sample you have posted here.

So changing your memory usage by moving to statically allocated memory may just 'hide the dirt underneath the carpet' :-)

 Bernard


_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to