δΊ 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