qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 3/4] qobject: replace qobject_incref/QINCREF


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v3 3/4] qobject: replace qobject_incref/QINCREF qobject_decref/QDECREF
Date: Fri, 13 Apr 2018 18:13:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 29/03/2018 18:23, Eric Blake wrote:
>>
>>   +/**
>> + * qobject_ref(): Increment QObject's reference count
>> + */
>> +#define qobject_ref(obj)                        \
>> +    qobject_ref(QOBJECT(obj))
> 
> ...below the functions of the same name.  C preprocessor rules guarantee
> that you don't get infinite expansion, although I did a double-take the
> first time I read through the patch (especially since your v2 used the
> name qobject_ref_impl() for the function, distinct from the macro name).
>  Worth a comment?

I prefer qobject_ref_impl, FWIW.  There are already a few examples in
include/qemu/thread.h and include/qemu/coroutine.h.

Thanks,

Paolo



reply via email to

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