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

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



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

Attachment: signature.asc
Description: OpenPGP digital signature


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