Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Nov 2013 03:17:56 -0800
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        FreeBSD Current <current@freebsd.org>
Subject:   [RFC] how to get the size of a malloc(9) block ?
Message-ID:  <CA%2BhQ2%2BiNurBQnmH-4-DN9V-krc_R=dbEaznJkxLDOzkJEWpFMg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BhQ2%2BiNurBQnmH-4-DN9V-krc_R=dbEaznJkxLDOzkJEWpFMg>