[lkml]   [2001]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] if (foo) kfree(foo) /fs cleanup + reverted JBD code path changes
You present some good arguments against the patch, i did it initially to
remove the double check and i would think the most common path would be a
kfree in any case (I can't back this up with proof) so its not that
expensive, so instead of;

if (foo) {
foo = NULL;

we can /* as whoever wrote kfree intended */

foo = NULL;

I would think in any case if we were looking at optimisation, the
assignment is roughly on par with the compare and saves you a bit on the
other case.

Alan Cox also suggested the BUG() trigger in there, with the
resultant breakage that would bring about. But i think its ok as long as
you don't call kfree with uninitialised variables or some such or forget
to set them to NULL at some point.

Zwane Mwaikambo

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.075 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site