lkml.org 
[lkml]   [2006]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 1/4] kevent: core files.
On 7/9/06, Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
> +struct kevent *kevent_alloc(gfp_t mask)
> +{
> + struct kevent *k;
> +
> + if (kevent_cache)
> + k = kmem_cache_alloc(kevent_cache, mask);
> + else
> + k = kzalloc(sizeof(struct kevent), mask);
> +
> + return k;
> +}

What's this for? Why would kevent_cache be NULL? Note that you can use
kmem_cache_zalloc() for fixed size allocations that need to be zeroed.

On 7/9/06, Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
> +
> +void kevent_free(struct kevent *k)
> +{
> + memset(k, 0xab, sizeof(struct kevent));

Why is slab poisoning not sufficient?

> + if (kevent_cache)
> + kmem_cache_free(kevent_cache, k);
> + else
> + kfree(k);
> +}
-
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: 2006-07-09 17:03    [W:0.341 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site