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

From: jb <jb.1234abcd_at_gmail.com>
Date: Sun, 1 Dec 2013 16:11:52 +0000 (UTC)
Daniel Nebdal <dnebdal <at> gmail.com> writes:

> ...
> That could alternatively be solved by having an "if I ask for N bytes right
> now, how large would the block be" - API that doesn't promise too much.
> Call it something like "malloc_suggest_size(size_t minsize) ", and make the
> description something like ...  "return the largest number of bytes that
> would not allocate a larger block of memory than the provided minsize, in
> the current memory situation", plus some veiled threats about not using
> this value to do anything fancy with pointers to already-allocated memory.

Yeap. It is like asking teenagers to be abstinent ...
http://www.youtube.com/watch?v=SWlbN2b1PGg

Good luck !
jb
 
Received on Sun Dec 01 2013 - 15:12:26 UTC

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