[libvirt] [PATCH v3 01/10] Add a generic reference counted virObject type

Eric Blake eblake at redhat.com
Mon Aug 6 16:09:15 UTC 2012


On 08/06/2012 05:52 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at 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 at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120806/0f66ce77/attachment-0001.sig>


More information about the libvir-list mailing list