qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V10 5/7] libqblock type defines


From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH V10 5/7] libqblock type defines
Date: Thu, 22 Nov 2012 09:50:01 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121026 Thunderbird/16.0.2

于 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]