[libvirt] [PATCH 5/7] util: alloc: Introduce 'VIR_AUTOCLEAN' macros for clearing stack'd structs

Peter Krempa pkrempa at redhat.com
Fri Feb 22 07:23:38 UTC 2019


On Thu, Feb 21, 2019 at 11:48:56 -0600, Eric Blake wrote:
> On 2/21/19 9:50 AM, Peter Krempa wrote:
> > The new utility macros are useful for variables we put on the stack but
> > require some cleanup. The most prominent of those is virBuffer which is
> > used almost exclusively in that way.
> > 
> > Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> > ---
> >  src/util/viralloc.h | 32 +++++++++++++++++++++++++++++++-
> >  1 file changed, 31 insertions(+), 1 deletion(-)
> > 
> 
> > 
> > +/**
> > + * VIR_AUTOCLEAN:
> > + * @type: type of the variable to be cleared
> 
> To match what VIR_AUTOUNREF does, should this state:
> to be clean'd automatically
> 
> > + *
> > + * Macro to automatically calls destructor of @type variable declared directly
> 
> s/calls/call/

I should read the whole sentence when modifying it :)

> 
> Is it actually a destructor, or just a cleanup function?

I got carried away slightly. It's just a cleanup function. I'll tweak
the comments.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190222/708297f9/attachment-0001.sig>


More information about the libvir-list mailing list