From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afVG3-0007Gs-FE for qemu-devel@nongnu.org; Mon, 14 Mar 2016 12:22:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afVG0-0004QZ-PA for qemu-devel@nongnu.org; Mon, 14 Mar 2016 12:22:15 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:34457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afVG0-0004QL-Gh for qemu-devel@nongnu.org; Mon, 14 Mar 2016 12:22:12 -0400 Received: by mail-wm0-x243.google.com with SMTP id p65so16233056wmp.1 for ; Mon, 14 Mar 2016 09:22:12 -0700 (PDT) Sender: Paolo Bonzini References: <1457959602-6472-1-git-send-email-aesmade@gmail.com> <56E6D979.5000900@redhat.com> From: Paolo Bonzini Message-ID: <56E6E531.8000001@redhat.com> Date: Mon, 14 Mar 2016 17:22:09 +0100 MIME-Version: 1.0 In-Reply-To: <56E6D979.5000900@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3] net.c: Moved large array in nc_sendv_compat from the stack to the heap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Nikos Filippakis , qemu-devel@nongnu.org Cc: jasowang@redhat.com On 14/03/2016 16:32, Eric Blake wrote: >> + const size_t STACKBUF_SIZE = 2048; >> + >> + uint8_t *buffer, *dynbuf = NULL; >> + uint8_t stackbuf[STACKBUF_SIZE]; Instead of using the "STACKBUF_SIZE" constant, you can use just "stackbuf[2048]", and then use sizeof(stackbuf) below. This is even more future proof. Paolo