Displaying 7 results from an estimated 7 matches for "_user_data".
Did you mean:
user_data
2019 Aug 13
2
Re: [PATCH libnbd 5/6] generator: Implement OClosure.
...; : \"NULL\"" cbname
Well, it also permits a NULL fn pointer.
> @@ -4383,6 +4387,16 @@ let print_python_binding name { args; optargs; ret; may_set_error } =
> ) args;
> List.iter (
> function
> + | OClosure { cbname } ->
> + pr " if (%s_user_data) {\n" cbname;
> + pr " /* Increment refcount since pointer may be saved by libnbd. */\n";
> + pr " Py_INCREF (%s_user_data);\n" cbname;
> + pr " if (!PyCallable_Check (%s_user_data)) {\n" cbname;
I don't think PyNone is cal...
2019 Aug 13
0
Re: [PATCH libnbd 5/6] generator: Implement OClosure.
...a NULL fn pointer.
This is right isn't it?
> > @@ -4383,6 +4387,16 @@ let print_python_binding name { args; optargs; ret; may_set_error } =
> > ) args;
> > List.iter (
> > function
> > + | OClosure { cbname } ->
> > + pr " if (%s_user_data) {\n" cbname;
> > + pr " /* Increment refcount since pointer may be saved by libnbd. */\n";
> > + pr " Py_INCREF (%s_user_data);\n" cbname;
> > + pr " if (!PyCallable_Check (%s_user_data)) {\n" cbname;
>
> I don&...
2019 Jul 24
0
[PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...= function
| BytesOut (n, len) -> [n; len]
| BytesPersistIn (n, len) -> [n; len]
| BytesPersistOut (n, len) -> [n; len]
-| Closure (_, closures) ->
- List.map (fun { cbname } -> cbname) closures @ ["user_data"]
+| Closure (_, { cbname }) -> [cbname; sprintf "%s_user_data" cbname ]
| Flags n -> [n]
| Int n -> [n]
| Int64 n -> [n]
@@ -3241,19 +3228,16 @@ let rec print_arg_list ?(handle = false) ?(user_data = false)
pr "%s, " n;
if types then pr "size_t ";
pr "%s" len
- | Closure (_, cls...
2019 Jul 24
8
[PATCH libnbd v2 0/5] lib: Implement closure lifetimes.
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-July/thread.html#00231
The changes address everything that Eric picked up in his review of
the first two patches. I have also added two more patches (4 and 5)
which respectively fix docs and change int status -> unsigned status,
as discussed.
Passes make, check, check-valgrind.
Rich.
2019 Jul 24
6
[PATCH libnbd 0/3] Implement closure lifetimes.
This implements most of what I wrote here:
https://www.redhat.com/archives/libguestfs/2019-July/msg00213.html
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...r (
function
- | Callback (cb_name, args) | CallbackPersist (cb_name, args) ->
- pr "struct %s_%s_data {\n" name cb_name;
- pr " PyObject *fn;\n";
- pr " PyObject *data;\n";
+ | Closure (persistent, cls) ->
+ pr "struct %s_user_data {\n" name;
+ List.iter (
+ fun { cbname } ->
+ pr " PyObject *%s;\n" cbname
+ ) cls;
pr "};\n";
pr "\n";
- pr "static int\n";
- pr "%s_%s_wrapper " name cb_name;
- print_c_arg_...
2019 Jul 16
2
[PATCH libnbd v2] generator: Define new Closure type
As before, but this one has working Python bindings. OCaml still TBD.
Rich.