On 3/29/19 3:40 AM, Richard W.M. Jones wrote: >>> + nbdkit_extents_free (extents2); >>> + >> >> Should we be using the CLEANUP_EXTENTS_FREE macro here and in other filters? > > At the moment the CLEANUP_* macros are only available to server code, > not to plugins or filters. They would certainly make plugins and > filters easier to write. I would really like attribute((cleanup)) to > turn up in ISO C one day :-)
Justifying it in plugins may or may not be doable (we'd have to have proper inclusion guards so that the cleanup functions are only declared for capable compilers. For filters it may be easier: we already document that all filters might as well live in-tree because we don't guarantee a stable API (case in point - we broke API between 1.11.9 and 1.11.10, and didn't think twice about it). So we know our filters are being compiled with a capable compiler. I don't know if we are installing nbdkit-filters.h in a public location, but it really isn't all that useful outside of nbdkit sources. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Libguestfs mailing list [email protected] https://www.redhat.com/mailman/listinfo/libguestfs
