public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] New discussion proposal for u-boot summit: "switch malloc to succeed or die model, as glib does"
Date: Sun, 12 Oct 2014 10:49:44 +0200	[thread overview]
Message-ID: <543A40A8.1030204@redhat.com> (raw)
In-Reply-To: <543A3EF4.9050304@redhat.com>

Hi,

On 10/12/2014 10:42 AM, Hans de Goede wrote:
> Hi All,
> 
> Sorry for the poor timing in bringing this up, but this just
> came up when discussing the review of some sunxi patches.
> 
> Ian asked me to add error handling for mmc_create failing,
> which, if used properly, only ever fails if calloc fails.
> 
> This made me thinking that we should switch u-boot to the
> glib memory alloc failure handling model, which is put a
> die() / abort() inside the low level malloc routines when
> they fail.

I remembered that I've already seen something like this in
u-boot, so after some grepping around I've found that at least
common/cli_hush.c already does this. It introduces a (private)
xmalloc and xrealloc which have the malloc_or_die behavior.

Regards,

Hans

  reply	other threads:[~2014-10-12  8:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-12  8:42 [U-Boot] New discussion proposal for u-boot summit: "switch malloc to succeed or die model, as glib does" Hans de Goede
2014-10-12  8:49 ` Hans de Goede [this message]
2014-10-12 10:40 ` Detlev Zundel

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=543A40A8.1030204@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=u-boot@lists.denx.de \
    /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