_reclaim_reent() and printf()
Rob Meades
Rob.Meades@u-blox.com
Sat Nov 14 22:25:27 GMT 2020
I'm using an STM32F4 processor with newlib nano and FreeRTOS. Have it all running quite sweetly, re-entrantly using the Dave Nadler code. However, I find that the first call to printf() in a new task allocates 1468 bytes of memory and that memory is NOT reclaimed by the call to _reclaim_reent() that FreeRTOS makes on task deletion.
Has anyone seen a problem of this nature? I note that at the end of _reclaim_reent() there's a comment:
/* Malloc memory not reclaimed; no good way to return memory anyway. */
Is this refering to memory malloc()ed by newlib, in which case why could it not be free'd()? Or is my problem more likely to be something specific to ST's HAL (I haven't found anything yet, and would be surprised if a HAL malloc()ed memory)?
More information about the Newlib
mailing list