Date: Sun, 1 Dec 2013 16:11:52 +0000 (UTC) From: jb <jb.1234abcd@gmail.com> To: freebsd-current@freebsd.org Subject: Re: [RFC] how to get the size of a malloc(9) block ? Message-ID: <loom.20131201T170436-874@post.gmane.org> References: <CA%2BhQ2%2BgK1pc_aS1LEKp29Bi=MHFtJCkw2uOrib_9wQ-7AziH=w@mail.gmail.com> <loom.20131130T002152-608@post.gmane.org> <CA%2BhQ2%2Bj0cYW0dfhEtMGRXWhXhS=VF_N_ZB=JmcqRUofFKWXFiQ@mail.gmail.com> <CAJ-Vmon2dy94jCUwrBjObrxahmaTyqYZJZo4Lren2Km_vX3_OA@mail.gmail.com> <CA%2BhQ2%2Bi7woEM9x7Ymo%2BD4FbG2rn0eRYnX=7mUTrPjDqj-pme7A@mail.gmail.com> <20131201022002.GE55638@funkthat.com> <529AA73A.9@gmx.com> <CA%2Bt49PJrbbtyaGX2KQm7L0fhzkhU9Cmxi3sehm79NyAChMeBjA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?loom.20131201T170436-874>