From owner-freebsd-current@FreeBSD.ORG Sat Nov 30 04:38:01 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 F20FF267 for ; Sat, 30 Nov 2013 04:38:01 +0000 (UTC) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C23ED1983 for ; Sat, 30 Nov 2013 04:38:01 +0000 (UTC) Received: by mail-pb0-f46.google.com with SMTP id md12so15523081pbc.19 for ; Fri, 29 Nov 2013 20:37:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=x7XNsJC3q2yW2dnRMJc1WHinMktemKBjBIGF/pODZOs=; b=Iw9qzFbO+PjyWfags0ZwzqkX4SD27V/57gM7Vf7C1Kr6wZsqzJEzwAS/U8ayyj9uqW xwka++RyV2AP4w/xrSoNm5pMjv/LAt5eK+CABO9QqD8qWiuqwpdoXBvMSJaLbqoothbc d34MHdLsZJgdoiqHsMfdAMBshPAi7k7QxtdW/wp4qZYvuF8qZYLZSjiH7ZWr+QprWZMr EZoX8gwEse7hf0Jp3mN8NKLdbZnB9ERLHiFbZqhem8heNDd5YXxugE+lJcdp5snfXByV uu/0OXwZnDj78BLuF6Y37KI+kf49+LqT7NcuYIZwR8e4egMsXxOA9JAszz4KBClM4OuC wCaQ== X-Gm-Message-State: ALoCoQnUjIdXuIv5tM19GXX/8hNGXqdzr1MCV+M/CYzj7AXDyUNWuHFY7aFME8YC0oqK9YvfeIom X-Received: by 10.68.254.164 with SMTP id aj4mr115199pbd.161.1385786274856; Fri, 29 Nov 2013 20:37:54 -0800 (PST) Received: from [192.168.2.123] (99-74-169-43.lightspeed.sntcca.sbcglobal.net. [99.74.169.43]) by mx.google.com with ESMTPSA id de1sm105859312pbc.7.2013.11.29.20.37.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 20:37:54 -0800 (PST) Sender: Tim Kientzle Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: [RFC] how to get the size of a malloc(9) block ? From: Tim Kientzle In-Reply-To: Date: Fri, 29 Nov 2013 20:37:28 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <8BCD215D-55D8-452F-AAFC-8BC07AEDB76C@freebsd.org> References: To: jb X-Mailer: Apple Mail (2.1822) Cc: FreeBSD current 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: Sat, 30 Nov 2013 04:38:02 -0000 On Nov 29, 2013, at 3:44 PM, jb wrote: > Luigi Rizzo iet.unipi.it> writes: >=20 >> ...=20 >> There is a difference between applications peeking into >> implementation details that should be hidden, and providing >> instead limited and specific information through a well defined API. >> ... >=20 > Right. >=20 > If you want to improve memory management, that is, have the system = (kernel > or user space) handle memory reallocation intelligently and = transparently > to the user, then aim at a well defined API: Don=92t forget: * Request a block of =93at least N bytes=94 and have the allocator tell you what it *really* allocated. This allows applications to use memory more efficiently by taking advantage of over-allocation when it happens. Tim