search for: guestfs___safe_asprintf

Displaying 4 results from an estimated 4 matches for "guestfs___safe_asprintf".

2013 Jan 24
2
[PATCH 1/2] lib: Add CLEANUP_FREE macro which automatically calls 'free' when leaving scope.
...cleanup(...)))' works with this compiler.]) + ],[ + AC_MSG_RESULT([no]) + ]) + dnl Check if dirent (readdir) supports d_type member. AC_STRUCT_DIRENT_D_TYPE diff --git a/src/alloc.c b/src/alloc.c index 25d7f42..cf3741a 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -122,3 +122,22 @@ guestfs___safe_asprintf (guestfs_h *g, const char *fs, ...) return msg; } + +void +guestfs___cleanup_free (void *ptr) +{ + free (* (void **) ptr); +} + +#ifndef HAVE_ATTRIBUTE_CLEANUP +void +guestfs___defer_free (guestfs_h *g, void (*freefn) (void *), void *data) +{ + struct deferred_free *p = safe_malloc (g, size...
2013 Jan 25
4
[PATCH 0/3] Use __attribute__((cleanup(...)))
This patch series changes a small part of the library to use __attribute__((cleanup(...))) to automatically free memory when pointers go out of the current scope. In general terms this seems to be a small win although you do have to use it carefully. For functions where you can completely get rid of the "exit code paths", it can simplify things. For a good example, see the
2013 Aug 24
46
[PATCH 00/46] Proposed patches for libguestfs 1.20.11.
Tested with 'make check-release'. tests/parallel (in check-slow) failed, although it does regularly and that seems to be because of libvirt. Rich.
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers. These aren't valid for global names in C++. (http://stackoverflow.com/a/228797) These large but completely mechanical patches change the illegal identifiers to legal ones. Rich.