Open
Description
I did a quick local test in my esp32-camera branch and found that annotating m_malloc
with __attribute__((return_nonnull))
saved 136 bytes in feather_m4_express. However, I also tried it real quick in micropython bare-arm and it did not help.
In principle, this helps the optimizer remove if-checks that follow (possibly across translation unit boundaries if lto is enabled, which it is for our atmel-samd but not for micropython's bare-arm) and in practice it looks like it was helpful to us.
I think this merits some further examination, including finding additional functions to annotate and more measurements to take.