All of lore.kernel.org
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Early malloc() summary
Date: Thu, 16 Aug 2012 21:39:00 +1000	[thread overview]
Message-ID: <502CDBD4.7090508@gmail.com> (raw)
In-Reply-To: <201208150156.32843.marex@denx.de>

Hi Marek,

On 08/15/2012 09:56 AM, Marek Vasut wrote:
> Dear Graeme Russ,
> 
> [...]
> 
>>
>> Third path is dm_malloc() - Although ugly, it has a few nicities...
> 
> Thinking about dm_malloc() ... if it's entirely different, the semantics can be 
> adjusted too ... say to "int dm_malloc(void **ptr, size_t size);":
> 
> - return int: error code
> - **ptr: pointer to allocated memory, that way we can possibly implement pointer 
> tracking (of course that'd need more work, might be a debug feature)
> - size: size of allocated area

I think we should keep the semantics as close as possible to malloc(). If
there is an error, return NULL. For starters, if we do later go with a
common malloc() which gets wrapped, changing the code will be a lot easier.

Regards,

Graeme

  reply	other threads:[~2012-08-16 11:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09  0:55 [U-Boot] Early malloc() summary Graeme Russ
2012-08-09 12:48 ` Wolfgang Denk
2012-08-11 23:16   ` Marek Vasut
2012-08-14  8:11     ` Tomas Hlavacek
2012-08-14 12:37       ` Marek Vasut
2012-08-14 13:08         ` Albert ARIBAUD
2012-08-14 14:40           ` Marek Vasut
2012-08-14 13:54         ` Graeme Russ
2012-08-14 14:00           ` Marek Vasut
2012-08-16 11:25             ` Graeme Russ
2012-08-16 14:52               ` Marek Vasut
2012-08-16 23:05                 ` Graeme Russ
2012-08-14 23:56           ` Marek Vasut
2012-08-16 11:39             ` Graeme Russ [this message]
2012-08-15 12:00           ` Tomas Hlavacek
2012-08-16 11:56             ` Graeme Russ
2012-08-16 14:50               ` Marek Vasut
2012-08-16 23:03                 ` Graeme Russ
2012-08-16 23:32                   ` Marek Vasut
2012-08-16 23:50                     ` Graeme Russ
2012-08-17  0:34                       ` Marek Vasut
2012-08-17  1:15                         ` Graeme Russ
2012-08-19 13:21                           ` Tomas Hlavacek
2012-08-19 23:47                             ` Graeme Russ

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=502CDBD4.7090508@gmail.com \
    --to=graeme.russ@gmail.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 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.