Re: kfree(NULL)

From: Jörn Engel
Date: Sat Apr 22 2006 - 16:09:40 EST


On Fri, 21 April 2006 13:30:30 -0700, Vernon Mauery wrote:
>
> A simple NULL check is faster
> than a function call and then a simple NULL check.

I am not sure whether this is still true for any non-ancient CPUs.
The cost of a branch misprediction is in the order of _many_
predictable instructions. That makes conditionals more expensive than
they used to be. And the cost of branch mispredictions keeps
increasing.

Jörn

--
You can take my soul, but not my lack of enthusiasm.
-- Wally
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/