[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 01/29] Introduce QObject
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] Re: [PATCH 01/29] Introduce QObject |
Date: |
Thu, 20 Aug 2009 16:21:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3 |
On 08/20/2009 04:17 PM, Luiz Capitulino wrote:
On Thu, 20 Aug 2009 10:34:46 +0200
Paolo Bonzini<address@hidden> wrote:
+/* High-level interface for qobject_incref() */
+#define QINCREF(qtype) \
+#define QDECREF(qtype) \
Why "qtype"?
Why not?
Because it's an object, not a type. :-)
+typedef struct QType {
+ qtype_code code;
+ void (*destroy)(struct QObject *);
+} QType;
...
+/* Get the QObject part of a type */
+#define QOBJECT(obj) (&obj->base)
+
+/* High-level interface for qobject_incref() */
+#define QINCREF(qtype) \
+ assert(qtype != NULL); \
+ qobject_incref(QOBJECT(qtype))
Paolo
[Qemu-devel] Re: [PATCH 01/29] Introduce QObject, Paolo Bonzini, 2009/08/20
[Qemu-devel] [PATCH 02/29] Introduce QInt, Luiz Capitulino, 2009/08/19
- [Qemu-devel] Re: [PATCH 02/29] Introduce QInt, Avi Kivity, 2009/08/20
- [Qemu-devel] Re: [PATCH 02/29] Introduce QInt, Paolo Bonzini, 2009/08/20
- [Qemu-devel] Re: [PATCH 02/29] Introduce QInt, Luiz Capitulino, 2009/08/20
- [Qemu-devel] Re: [PATCH 02/29] Introduce QInt, Avi Kivity, 2009/08/20
- [Qemu-devel] Re: [PATCH 02/29] Introduce QInt, Luiz Capitulino, 2009/08/20
- [Qemu-devel] Re: [PATCH 02/29] Introduce QInt, Avi Kivity, 2009/08/20