Displaying 10 results from an estimated 10 matches for "safe_memdup".
2009 Nov 18
1
[PATCH] generator: Fix API of functions that return RBufferOut
...@@ -5107,7 +5109,7 @@ and generate_client_actions () =
#define error guestfs_error
//#define perrorf guestfs_perrorf
-//#define safe_malloc guestfs_safe_malloc
+#define safe_malloc guestfs_safe_malloc
#define safe_realloc guestfs_safe_realloc
//#define safe_strdup guestfs_safe_strdup
#define safe_memdup guestfs_safe_memdup
@@ -5396,8 +5398,20 @@ check_state (guestfs_h *g, const char *caller)
pr " /* caller will free this */\n";
pr " return safe_memdup (g, &ret.%s, sizeof (ret.%s));\n" n n
| RBufferOut n ->
- pr " *size_r...
2009 Nov 19
1
[PATCH libguestfs] syntax-check: expand TABs in generator.ml
...deletions(-)
diff --git a/src/generator.ml b/src/generator.ml
index 2317541..c261ea2 100644
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -5398,20 +5398,20 @@ check_state (guestfs_h *g, const char *caller)
pr " /* caller will free this */\n";
pr " return safe_memdup (g, &ret.%s, sizeof (ret.%s));\n" n n
| RBufferOut n ->
- pr " /* RBufferOut is tricky: If the buffer is zero-length, then\n";
- pr " * _val might be NULL here. To make the API saner for\n";
- pr " * callers, we turn this case into a uniqu...
2014 Nov 17
3
Re: [PATCH] list-applications: Add support for pacman
OK, I'll try to fix the epoch thing for all three.
Nikos
On 17 November 2014 13:49, Richard W.M. Jones <rjones@redhat.com> wrote:
> On Mon, Nov 17, 2014 at 01:41:28PM +0200, Nikos Skalkotos wrote:
>> OK, I'll make the suggested changes and I'll try to come up with a new
>> patch by tomorrow or the day after tomorrow. I just noticed that a
>> space is
2016 Feb 05
7
[PATCH 0/7] lib: Stop exporting the safe_malloc, etc. functions.
The safe_malloc (etc) functions call g->abort_fn on failure. That's
not appropriate for language bindings, and we never intended that
these internal functions be used from language bindings, that was just
a historical accident.
This patch series removes any external use of the safe_* functions.
Rich.
2013 Jan 24
2
[PATCH 1/2] lib: Add CLEANUP_FREE macro which automatically calls 'free' when leaving scope.
...free {
+ struct deferred_free *next;
+ void (*freefn) (void *);
+ void *data;
+};
+#endif
+
/* Per-filesystem data stored for inspect_os. */
enum inspect_os_format {
OS_FORMAT_UNKNOWN = 0,
@@ -474,6 +499,14 @@ extern char *guestfs___safe_asprintf (guestfs_h *g, const char *fs, ...)
#define safe_memdup guestfs___safe_memdup
#define safe_asprintf guestfs___safe_asprintf
+/* These functions are used internally by the CLEANUP_* macros.
+ * Don't call them directly.
+ */
+extern void guestfs___cleanup_free (void *ptr);
+#ifndef HAVE_ATTRIBUTE_CLEANUP
+extern void guestfs___defer_free (guestfs_...
2012 Jul 14
6
[PATCH 0/6] Allow non-optargs functions to gain optional arguments.
This rather complex set of patches allow non-optargs functions to gain
optional arguments, while preserving source and binary backwards
compatibility.
The problem is that we cannot add an optional argument to an existing
function. For example, we might want to add flags to the 'lvresize'
API which currently has no optional arguments.
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
2012 Oct 18
10
[PATCH 0/10] Add a mini-library for running external commands.
Inspired by libvirt's virCommand* internal mini-library, this adds
some internal APIs for running commands.
The first patch contains the new APIs. The subsequent patches change
various parts of the library over to use it.
Rich.
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...et.%s.%s_len + 1));\n"
+ n n;
+ pr " ctx.ret.%s.%s_val[ctx.ret.%s.%s_len] = NULL;\n" n n n n;
+ pr " return ctx.ret.%s.%s_val;\n" n n
| RStruct (n, _) ->
- pr " /* caller will free this */\n";
- pr " return safe_memdup (g, &ctx.ret.%s, sizeof (ctx.ret.%s));\n" n n
+ pr " /* caller will free this */\n";
+ pr " return safe_memdup (g, &ctx.ret.%s, sizeof (ctx.ret.%s));\n" n n
| RStructList (n, _) ->
- pr " /* caller will free this */\n";...
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.