public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Rob Meades <Rob.Meades@u-blox.com>
To: "newlib@sourceware.org" <newlib@sourceware.org>
Subject: _reclaim_reent() and printf()
Date: Sat, 14 Nov 2020 22:25:27 +0000	[thread overview]
Message-ID: <sig.1587aa77dc.CWXP265MB00392C5720A2A595DD7D0C55BEE50@CWXP265MB0039.GBRP265.PROD.OUTLOOK.COM> (raw)

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)?

             reply	other threads:[~2020-11-14 22:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-14 22:25 Rob Meades [this message]
2020-11-14 23:12 ` Dave Nadler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sig.1587aa77dc.CWXP265MB00392C5720A2A595DD7D0C55BEE50@CWXP265MB0039.GBRP265.PROD.OUTLOOK.COM \
    --to=rob.meades@u-blox.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).