lkml.org 
[lkml]   [2006]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kfree(NULL)
>> > I don't actually like kfree(NULL) any time except error paths. It is
>> > subjective, not crazy talk.
>>
>> Documented interface is not subjective.
>
> That's great. I don't know quite how to reply, or even if I should
> if you don't read what I write.

Where's the problem, if a developer does not know whether an object is NULL
or not, he may call kfree(). If, on the other hand, he is sure it is NULL,
there is no need to refree it, and if he is sure it is non-NULL, he can
directly call __kfree(). So the readability can never suffer - you never
need an if(x==NULL) anymore.

Jan Engelhardt
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-22 22:23    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site