[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V10 5/7] libqblock type defines
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH V10 5/7] libqblock type defines |
Date: |
Wed, 21 Nov 2012 09:05:23 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 |
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
- [Qemu-devel] [PATCH V10 3/7] block export function path_has_protocol, (continued)
[Qemu-devel] [PATCH V10 5/7] libqblock type defines, Wenchao Xia, 2012/11/20
[Qemu-devel] [PATCH V10 6/7] libqblock API, Wenchao Xia, 2012/11/20
[Qemu-devel] [PATCH V10 7/7] libqblock test example, Wenchao Xia, 2012/11/20