lkml.org 
[lkml]   [2013]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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@gmail.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
begin:vcard
fn:Chen Gang
n:;Chen Gang
version:2.1
end:vcard

\
 
 \ /
  Last update: 2013-01-14 03:01    [W:0.050 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site