Received: from eggs.gnu.org ([2001:4830:134:3::10]:35977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1uD3-00028u-Fh for qemu-devel@nongnu.org; Wed, 02 Nov 2016 08:00:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1uCy-0006mh-LI for qemu-devel@nongnu.org; Wed, 02 Nov 2016 08:00:01 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56044 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c1uCy-0006mL-Gv for qemu-devel@nongnu.org; Wed, 02 Nov 2016 07:59:56 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA2BwstK145161 for ; Wed, 2 Nov 2016 07:59:55 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0b-001b2d01.pphosted.com with ESMTP id 26fakk93p3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 02 Nov 2016 07:59:55 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 2 Nov 2016 05:59:54 -0600 References: <20161012204907.25941-1-mreitz@redhat.com> <20161012204907.25941-3-mreitz@redhat.com> <7be11d16-d2ae-e892-5f97-17f971859a3a@linux.vnet.ibm.com> <20161102111524.GE6182@noname.redhat.com> From: Hao QingFeng Date: Wed, 2 Nov 2016 19:59:58 +0800 MIME-Version: 1.0 In-Reply-To: <20161102111524.GE6182@noname.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/3] block: Emit modules in bdrv_iterate_format() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Max Reitz , qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi =E5=9C=A8 2016-11-02 19:15, Kevin Wolf =E5=86=99=E9=81=93: > Am 02.11.2016 um 11:52 hat Hao QingFeng geschrieben: >> Sorry for a bit late response. The function looks fine but just some >> doubt on g_renew in this piece of code(and the legacy), does >> g_renew(realloc) has much performance impact if it's call many times >> since alloc and memory copy are both also run many times? So how >> about increase the memory for more instead of 1 each time? >> >> formats =3D g_renew(const char *, formats, count + 10); >> >> A new counter also needs to be introduced to record the space size. > This code is not on a hot path, so keeping the code simple and easy to > maintain is preferrable to complicating it just so --help can save a fe= w > CPU cycles. Got it. thanks! > Kevin > --=20 QingFeng Hao(Robin)