Found the source to malloc and it looks like the cause is the following code
inserted in AVR LibC 1.6.5:

if (cp <= __brkval)
 /*
  * Memory exhausted.
  */
 return 0;

If I read this correctly, since the AVRX task stack is under __brkval,
malloc won't work if called from a task.

Maybe I can put a wrapper around malloc to repoint the stack pointer so that
this line is valid:
cp = STACK_POINTER() - __malloc_margin;

-- 
View this message in context: 
http://www.nabble.com/malloc-changes-tp22982993p22983132.html
Sent from the AVR - Libc - Dev mailing list archive at Nabble.com.



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

Reply via email to