lkml.org 
[lkml]   [2009]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Export symbol ksize()
From
On Tue, Feb 17, 2009 at 6:17 PM, Christoph Lameter
<cl@linux-foundation.org> wrote:
> On Sun, 15 Feb 2009, Matt Mackall wrote:
>
>> And it -is- a category error. The fact that kmalloc is implemented on
>> top of kmem_cache_alloc is an implementation detail that callers should
>> not assume. They shouldn't call kfree() on kmem_cache_alloc objects
>> (even though it might just happen to work), nor should they call
>> ksize().
>
> ksize does not take a kmem_cache pointer and it is mainly used for
> figuring out how much space kmalloc really allocated for an object. As
> such its more part of the kmalloc/kfree set of calls than the
> kmem_cache_* calls.
>
> We could add another call
>
> kmem_cache_size()
>
> for symmetries sake.

Hmm, kmem_cache_size() seems bit pointless to me. For
kmem_cache_create()'d caches, actual allocated size should be more or
less optimal with no extra space.

Pekka


\
 
 \ /
  Last update: 2009-02-18 12:23    [W:0.075 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site