lkml.org 
[lkml]   [2004]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kfree calls cleanup


Benoît Dejean wrote:
> i've removed some useless test for NULL pointer before kfree calls.
> if(p) kfree(p) -> kfree(p)
> i've also removed variables that have become unused.
> the patch is quite big, but i've check it many times.


This is valid since kfree checks for null pointer, but while the extra
"if (p)" is redundant, if p is most often NULL somewhere, then you can
avoid the function call overhead by this very low-cost check. (Unless
kfree is a macro which includes the check in the macro.)

-
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: 2005-03-22 14:03    [W:0.032 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site