From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFToi-0001pY-Ju for qemu-devel@nongnu.org; Tue, 01 Dec 2009 09:35:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFTod-0001ie-Gz for qemu-devel@nongnu.org; Tue, 01 Dec 2009 09:34:59 -0500 Received: from [199.232.76.173] (port=60877 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFToc-0001iQ-J3 for qemu-devel@nongnu.org; Tue, 01 Dec 2009 09:34:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9572) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFToc-0007dX-6y for qemu-devel@nongnu.org; Tue, 01 Dec 2009 09:34:54 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB1EYrN1019558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Dec 2009 09:34:53 -0500 Message-ID: <4B15298B.90004@redhat.com> Date: Tue, 01 Dec 2009 16:34:51 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends References: <4B150EAD.4050502@redhat.com> In-Reply-To: <4B150EAD.4050502@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Markus Armbruster , qemu-devel@nongnu.org On 12/01/2009 02:40 PM, Gerd Hoffmann wrote: > > Even more advanced: Make zero_length_malloc page-sized and > page-aligned, then munmap int, so dereferencing it actually traps. That will cause vma fragmentation. Since we don't trap malloc(n)[n] for n > 0, we may as well not trap it for n = 0. -- error compiling committee.c: too many arguments to function