[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50F35CD3.9080300@gmail.com>
Date: Mon, 14 Jan 2013 09:18:11 +0800
From: Chen Gang F T <chen.gang.flying.transformer@...il.com>
To: Cong Ding <dinggnu@...il.com>
CC: antoine.trux@...il.com, fa.linux.kernel@...glegroups.com,
Johannes Weiner <hannes@...urebad.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
clameter@....com, penberg@...helsinki.fi
Subject: Re: Why is the kfree() argument const?
于 2013年01月14日 04:54, Cong Ding 写道:
> On Sun, Jan 13, 2013 at 9:10 AM, Chen Gang F T
> <chen.gang.flying.transformer@...il.com> wrote:
>> > all together:
>> > kfree() should use 'const void *' as parameter type
>> > the free() of C Library is incorrect (it use void *).
> you are definitely wrong. both of them are correct - it's the
> difference between kernel space and user space.
>
for API features, they are should be no different.
"- From a very obvious and very *real* caller perspective, 'free()' really
doesn't change the thing the pointer points to. It does something
totally different: it makes the *pointer* itself invalid."
"we want the types to be as tight as possible"
so should use 'const void *' both for 'kfree()' and 'free()' .
--
Chen Gang
Flying Transformer
View attachment "chen_gang_flying_transformer.vcf" of type "text/x-vcard" (67 bytes)
Powered by blists - more mailing lists