Re: Why is the kfree() argument const?

From: Chen Gang F T
Date: Sun Jan 13 2013 - 20:17:12 EST


ä 2013å01æ14æ 04:54, Cong Ding åé:
> On Sun, Jan 13, 2013 at 9:10 AM, Chen Gang F T
> <chen.gang.flying.transformer@xxxxxxxxx> 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
begin:vcard
fn:Chen Gang
n:;Chen Gang
version:2.1
end:vcard