Messages in this thread | | | Date | Tue, 17 Feb 2009 11:17:19 -0500 (EST) | From | Christoph Lameter <> | Subject | Re: [PATCH] Export symbol ksize() |
| |
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.
| |