The dsPic30/33 and 18E/F parts will produce memory faults if 16-bit accesses are made to memory on odd addresses. When allocating heap memory using malloc(), is the return address guaranteed to be word-aligned? (i.e. even)
malloc, you will recall, takes an argument in bytes, not words.
The documentation I've been able to find (16-bit Language Tools Library Reference Manual 50001456J.pdf) is mute on this issue.
====
Edit: I should add that I've only ever received even (word-aligned) addresses from malloc(), so everything's been working well so far. Nevertheless, my code will cause a trap if I ever get an odd address (because I do perform things like ((uint16_t *)foo)[3] = 20000;
). Therefore, I want to be sure that even address are always returned by malloc().