From owner-freebsd-current@FreeBSD.ORG Sun Dec 1 03:05:02 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C09EFD9 for ; Sun, 1 Dec 2013 03:05:02 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 225C81AFC for ; Sun, 1 Dec 2013 03:05:02 +0000 (UTC) Received: from [157.181.98.186] ([157.181.98.186]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MAUpK-1Vsygw0lEA-00Bblb for ; Sun, 01 Dec 2013 04:05:00 +0100 Message-ID: <529AA73A.9@gmx.com> Date: Sun, 01 Dec 2013 04:04:26 +0100 From: dt71@gmx.com User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:23.0) Gecko/20100101 Firefox/23.0 SeaMonkey/2.20 MIME-Version: 1.0 To: Luigi Rizzo , Adrian Chadd , freebsd-current , jb Subject: Re: [RFC] how to get the size of a malloc(9) block ? References: <20131201022002.GE55638@funkthat.com> In-Reply-To: <20131201022002.GE55638@funkthat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ZTco5Bl8PIVK9r7U9E0d92mmHH3WeNq4Zvshq3/nCtaKKm2iLRE sxK7VxdTVNHa/ajB8USuJ+dzpJoVR3R160PQZ9ihKEl1c/vk6W+ul274FYdQ2GLMhu3q+sI jFJmVYmIGMdxCxpkUi6BLYcPEsGD9egeubEtv3aTcx+txMqzilkrfi07XjO/wMXvhljER1A IePwd3/28UhHXWs5UbpQA== X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Dec 2013 03:05:02 -0000 John-Mark Gurney wrote, On 12/01/2013 03:20: > Either it happens rarely, and always doing a realloc won't hurt > performance, or it happens often, and then you should be using a larger > buffer in the first place.. What if a size-elastic implementation of a dynamic data structure would be able to adjust to the malloc implementation, such as agreeing to allocate regions of size (2^k - 8)? Much like the use of getpagesize() (yes, I know it's not part of a technical standard).