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

jb jb.1234abcd at gmail.com
Sat Nov 30 09:34:41 UTC 2013


 <dt71 <at> gmx.com> writes:

> ... 
> It appears that it's not possible to make a proper API with 
> malloc_usable_size() included, at least when
> multi-threading is involved (ie., in the modern world).
> 
> However, it is still useful to create an API that supports the following
cases:
> ...

Well, this is a step forward toward achieving a well defined API for memory
reallocation.

But can we arrive at this goal without consideration for leaked
implementation details via malloc_usable_size() & co ?
We want to get rid of that leak and associated hacks.

We want to induce reallocation function to do "the right thing" thru one API
call with clear and smart options.
If it does 90% of what we would ideally want, then the job is done.

jb




More information about the freebsd-current mailing list