On Thursday, 2020-08-27 at 14:28:03 +08, Zheng Chuan wrote:
>>>> +static struct RamblockDirtyInfo *
>>>> +alloc_ramblock_dirty_info(int *block_index,
>>>> + struct RamblockDirtyInfo *block_dinfo)
>>>> +{
>>>> + struct RamblockDirtyInfo *info = NULL;
>>>> + int index = *block_index;
>>>> +
>>>> + if (!block_dinfo) {
>>>> + index = 0;
>>>> + block_dinfo = g_try_new(struct RamblockDirtyInfo, 1);
>>>> + } else {
>>>> + index++;
>>>> + block_dinfo = g_try_realloc(block_dinfo, (index + 1) *
>>>> + sizeof(struct RamblockDirtyInfo));
>>>
>>> g_try_renew() instead of g_try_realloc()?
>>>
> Hi,
> I am not sure that because there only one place in qemu to use g_try_renew.
> Could you tell me why, because i think g_try_realloc will also return NULL
> when error happen:)
Only suggested because it would make the two branches of the code more
similar.
dme.
--
And you can't hold me down, 'cause I belong to the hurricane.