From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbLvj-0007bj-7N for qemu-devel@nongnu.org; Wed, 21 Nov 2012 20:50:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbLvh-0000bk-TZ for qemu-devel@nongnu.org; Wed, 21 Nov 2012 20:50:15 -0500 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:47819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbLvh-0000bb-9k for qemu-devel@nongnu.org; Wed, 21 Nov 2012 20:50:13 -0500 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 22 Nov 2012 07:20:11 +0530 Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qAM1o7rT983388 for ; Thu, 22 Nov 2012 07:20:07 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qAM7Jlmm029984 for ; Thu, 22 Nov 2012 18:19:47 +1100 Message-ID: <50AD84C9.7010309@linux.vnet.ibm.com> Date: Thu, 22 Nov 2012 09:50:01 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1353404767-4495-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1353404767-4495-6-git-send-email-xiawenc@linux.vnet.ibm.com> <50AB5BC5.9030605@redhat.com> <50AC469E.1060704@linux.vnet.ibm.com> <50AC8B43.40304@redhat.com> In-Reply-To: <50AC8B43.40304@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V10 5/7] libqblock type defines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, blauwirbel@gmail.com, kraxel@redhat.com 于 2012-11-21 16:05, Paolo Bonzini 写道: > Il 21/11/2012 04:12, Wenchao Xia ha scritto: >>>> >>>> +#define FUNC_FREE(p) g_free((p)) >>>> +#define FUNC_MALLOC(size) g_malloc((size)) >>>> +#define FUNC_CALLOC(nmemb, size) g_malloc0((nmemb)*(size)) >>>> +#define FUNC_STRDUP(p) g_strdup((p)) >>> >>> Why keep these? >> >> This macro make it easy to switch mem related functions if we change >> our mind in the future. > > I don't like it particularly. > > If you really want it, keep it, but please use g_malloc0_n for FUNC_CALLOC. > > Paolo > OK. -- Best Regards Wenchao Xia