From: Paulo Marques <pmarques@grupopie.com>
To: Pekka Enberg <penberg@gmail.com>
Cc: "Jörn Engel" <joern@wohnheim.fh-wedel.de>,
"Jesper Juhl" <juhl-lkml@dif.dk>,
"Roland Dreier" <roland@topspin.com>,
LKML <linux-kernel@vger.kernel.org>,
penberg@cs.helsinki.fi
Subject: Re: RFC: turn kmalloc+memset(,0,) into kcalloc
Date: Wed, 06 Apr 2005 16:50:56 +0100 [thread overview]
Message-ID: <42540560.2000205@grupopie.com> (raw)
In-Reply-To: <84144f02050406061077de4c2e@mail.gmail.com>
Pekka Enberg wrote:
> Hi,
>
> On Apr 6, 2005 3:15 PM, Paulo Marques <pmarques@grupopie.com> wrote:
>
>>However "calloc" is the standard C interface for doing this, so it makes
>>some sense to use it here as well... :(
>
>
> I initally submitted kcalloc() with just one parameter but Arjan
> wanted it to be similar to standard calloc() so we could check for
> overflows. I don't see any reason not to introduce kzalloc() for the
> common case you mentioned (as suggested by Denis).
kzalloc it is, then.
By the way I did a quick measurement to see how much we could gain in
kernel size by doing this. This is with a 2.6.11-rc2, defconfig kernel:
with kmalloc+memset:
vmlinuz: 5521614
bzImage: 2005274
with kzalloc:
vmlinuz: 5513422
bzImage: 2003927
So we gain 8kB on the uncompressed image and 1347 bytes on the
compressed one. This was just a dumb test and actual results might be
better due to smarter human cleanups.
Not a spectacular gain per se, but the increase in code readability is
still worth it, IMHO.
--
Paulo Marques - www.grupopie.com
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)
next prev parent reply other threads:[~2005-04-06 15:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-05 16:26 RFC: turn kmalloc+memset(,0,) into kcalloc Paulo Marques
2005-04-05 18:00 ` Jörn Engel
2005-04-06 12:09 ` Denis Vlasenko
2005-04-05 18:54 ` Jesper Juhl
2005-04-05 19:20 ` Roland Dreier
2005-04-05 20:01 ` Jesper Juhl
2005-04-06 11:28 ` Jörn Engel
2005-04-06 12:15 ` Paulo Marques
2005-04-06 13:10 ` Pekka Enberg
2005-04-06 15:50 ` Paulo Marques [this message]
2005-04-07 23:54 ` Kyle Moffett
2005-04-09 2:11 ` Jesper Juhl
2005-04-07 21:47 ` Adrian Bunk
2005-04-08 12:38 ` Paulo Marques
2005-04-08 13:00 ` Adrian Bunk
2005-04-08 13:20 ` Jörn Engel
2005-04-08 13:29 ` Adrian Bunk
2005-04-08 16:24 ` Paulo Marques
2005-04-08 19:43 ` Adrian Bunk
2005-04-08 19:49 ` Randy.Dunlap
2005-04-08 13:00 ` stack checking (was: Re: RFC: turn kmalloc+memset(,0,) into kcalloc) Jörn Engel
2005-04-09 14:19 ` RFC: turn kmalloc+memset(,0,) into kcalloc Paul Jackson
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=42540560.2000205@grupopie.com \
--to=pmarques@grupopie.com \
--cc=joern@wohnheim.fh-wedel.de \
--cc=juhl-lkml@dif.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
--cc=penberg@gmail.com \
--cc=roland@topspin.com \
/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.