The interrupt hooks for Due are great! Now RTOS ports run with no mods to Arduino 1.5.2. I will soon post 1.5.2 updates for all RTOS ports.
Now the not so good news for AVR. The new malloc() does not work in threads unless their stack is above the heap.
Here is the gotcha in malloc:
cp = STACK_POINTER() - __MALLOC_MARGIN__;
if (cp <= __brkval)
/*
* Memory exhausted.
*/
return 0;
If the stack pointer is below the heap, malloc() fails.
Personally I think this is a good thing. It enforces the embedded systems rule, "dynamic memory shall not be used after setup".
Due to its risk, dynamic memory allocation is forbidden, under the DO-178B standard, in safety-critical embedded avionics code.