Cc: Pekka Enberg <penberg@...>, Patrick McHardy <kaber@...>, Ingo Molnar <mingo@...>, David Miller <davem@...>, <w@...>, <davidn@...>, <torvalds@...>, <akpm@...>, <netdev@...>, <linux-kernel@...>, <stefanr@...>, <rjw@...>, <ilpo.jarvinen@...>, Dave Jones <davej@...>, Christoph Lameter <cl@...>
On Fri, 2008-07-25 at 09:39 +0800, Herbert Xu wrote:
I think that could probably be made to work. Perhaps something like:
size_t kmalloc_extra(void *); /* how many extra bytes in this kmalloc?
*/
Which, if it didn't work, could return a nice safe 0. We could argue
about signedness a bit, but I think this would always be safe.
This will also work with all our current kmalloc implementations. The
trouble was calling ksize() on kmem_cache_alloc objects, which happens
to work with SLAB and SLOB.
--
Mathematics is the supreme nostalgia of our time.
--