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

From: Jamie Lokier (lkd@tantalophile.demon.co.uk)
Date: Mon Jan 24 2000 - 16:37:10 EST


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@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:13 EST