[patch-2.3.40-pre6] kzalloc() (ala kmem_zalloc() of SVR4)

Jamie Lokier lkd en tantalophile.demon.co.uk
Mar Ene 25 00:25:08 CST 2000


Jeff Garzik wrote:
> >From the last discussion, I believe Jes if not others pointed out that
> adding GFP_ZERO meant adding something new to a speed-critical path,
> which might not be a good idea.

The test can be done at compile time in almost all cases.

static inline void kmalloc(size_t size, int gfp)
{
	if (!builtin_constant_p (gfp) || (gfp & GFP_ZERO))
		__kzalloc (size, gfp);
	else
		__kmalloc (size, gfp);
}

I don't advocate that particular approach but it's there if you want it.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



Más información sobre la lista de distribución Ayuda