
On 08/06/2012 05:52 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
This introduces a fairly basic reference counted virObject type and an associated virClass type, that use atomic operations for ref counting.
+virClassPtr virClassNew(const char *name, + size_t objectSize, + virObjectDisposeCallback dispose) +{ + virClassPtr klass; + + if (VIR_ALLOC(klass) < 0) { + virReportOOMError(); + return NULL; + }
This could be simplified to: if (VIR_ALLOC(klass) < 0) goto no_memory;
+/** + * virObjectFreeCallback: + * @opaque: a pointer to a virObject instance + * + * Provides identical functionality to virObjectUnref, + * but with the signature maching the virFreeCallback
s/maching/matching/ ACK. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org