[RFC] how to get the size of a malloc(9) block ?

From: Luigi Rizzo <rizzo_at_iet.unipi.it>
Date: Thu, 28 Nov 2013 03:17:56 -0800
in porting some linux kernel code to FreeBSD we
stumbled upon ksize(), which returns the
actual size of a kmalloc() block.

We could easily implement it as the first part
of realloc(9) -- see kern/kern_malloc.c

Would it make sense to add this to the malloc(9) API ?
The userspace equivalent seems to be
malloc_usable_size(3) which according to the
manpage appeared in FreeBSD 7.0

cheers
luigi
Received on Thu Nov 28 2013 - 10:17:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:44 UTC