All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] C99 and dynamic arrays
Date: Wed, 13 Mar 2013 17:06:46 +0100	[thread overview]
Message-ID: <20130313160646.5EE42200048@gemini.denx.de> (raw)
In-Reply-To: <CAPnjgZ2bSf8-9gw6MweexMUEXDTYNspxth0GA0XN3RpkLO4R8w@mail.gmail.com>

Dear Simon Glass,

In message <CAPnjgZ2bSf8-9gw6MweexMUEXDTYNspxth0GA0XN3RpkLO4R8w@mail.gmail.com> you wrote:
>
> >> Given that we seem to allow C99 features in U-Boot I wonder if it
> >> would be OK to use dynamic arrays in SPL?

Strange.  I can see the follow-ups, but I cannot see the original
posting?

> In the function pow_mod(), I would like to replace:
> 
> val = malloc(key->len * sizeof(uint32_t));
> 
> with:
> 
> uint32_t val[key->len];
> 
> malloc() adds at least 1KB, perhaps 2KB.

I think it is perfectly OK to do that.  Actually I think we already do
this in a number of places.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The trouble with doing something right the first time is that nobody
appreciates how difficult it was."                        - Walt West

  reply	other threads:[~2013-03-13 16:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAPnjgZ2211cc1ZQuFajVRdcr5qvJfRtmCp-_E-itTZLq4pbOfA@mail.gmail.com>
2013-03-12 23:48 ` [U-Boot] C99 and dynamic arrays Tom Rini
2013-03-13 10:29   ` Måns Rullgård
2013-03-13 17:01     ` Simon Glass
2013-03-13 18:03       ` Måns Rullgård
2013-03-13 18:36         ` Stephen Warren
2013-03-13 20:16           ` Måns Rullgård
2013-03-13 18:48         ` Simon Glass
2013-03-13 19:55           ` Måns Rullgård
2013-03-20  2:24             ` Steve Strobel
2013-03-13 10:41   ` Simon Glass
2013-03-13 16:06     ` Wolfgang Denk [this message]
2013-03-13 16:14     ` Tom Rini

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=20130313160646.5EE42200048@gemini.denx.de \
    --to=wd@denx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.