lkml.org 
[lkml]   [2002]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] kmem_cache_zalloc
On Wed, Mar 27, 2002 at 01:39:17PM -0600, Eric Sandeen wrote:
> In the interest of whittling down the changes that XFS makes to the core
> kernel, I thought I'd start throwing out some the easier self-contained
> modifications for discussion.
>
> XFS adds a kmem_cache_zalloc function to mm/slab.c, it does what you
> might expect: kmem_cache_alloc + memset

I'd really go for k(mem_)zalloc, but a kmem_cache_alloc leads people toward
writing bad code. The purpose of the slab allocator is to allow caching
readily constructed objects, a _zalloc destroys them on alloc.

I think code using kmem_cache_alloc really wants to use kzalloc and instead
of maintaining it's pool.

Christoph

-
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 13:25    [from the cache]
©2003-2011 Jasper Spaans