search for: s_buf

Displaying 20 results from an estimated 37 matches for "s_buf".

Did you mean: fs_buf
2019 Aug 12
0
[PATCH libnbd 3/7] ocaml: Remove NBD.Buffer.free function, use a free callback instead.
...= malloc (sizeof (value));\n" n; + pr " if (%s_user_data == NULL) caml_raise_out_of_memory ();\n" n; + pr " *%s_user_data = %sv;\n" n n; + pr " caml_register_generational_global_root (%s_user_data);\n" n; pr " struct nbd_buffer *%s_buf = NBD_buffer_val (%sv);\n" n n; pr " const void *%s = %s_buf->data;\n" n n; - pr " size_t %s = %s_buf->len;\n" count n - | BytesOut (n, count) -> - pr " void *%s = Bytes_val (%sv);\n" n n; - pr " size_t %s = caml_stri...
2009 Oct 05
3
Questions about app_jack.c
...well with anothers applications when I force them to use jack as input/output. -> probably not a jack configuration problem. 3) If I kill jackd and I use chan_alsa.so with the real soundcard, it works. -> probably not a network or sip configuration problem. 4) If I replace "f_buf[i] = s_buf[i] * (1.0 / SHRT_MAX);" with "f_buf[i] = 0.5 * sin(0.3454 * ((float) i));" in app_jack.c and I retry the test 2, I get test sound. It looks like no sound was read in channel... Do you have any idea ? Fabien
2020 Sep 10
1
[libnbd PATCH] python: Fix more memory leaks
...pr " char *%s = NULL;\n" n; pr " Py_ssize_t %s;\n" count | BytesPersistIn (n, _) | BytesPersistOut (n, _) -> @@ -279,11 +279,10 @@ let print_python_binding name { args; optargs; ret; may_set_error } = n; pr " struct py_aio_buffer *%s_buf;\n" n | Closure { cbname } -> - pr " struct user_data *%s_user_data = alloc_user_data ();\n" cbname; - pr " if (%s_user_data == NULL) goto out;\n" cbname; + pr " struct user_data *%s_user_data = NULL;\n" cbname; + pr " PyOb...
2020 Sep 08
2
[libnbd PATCH] python: Plug some memory leaks on error paths
...- pr " PyObject *py_ret;\n"; + pr " PyObject *py_ret = NULL;\n"; List.iter ( function | Bool n -> pr " int %s;\n" n @@ -279,7 +280,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = pr " struct py_aio_buffer *%s_buf;\n" n | Closure { cbname } -> pr " struct user_data *%s_user_data = alloc_user_data ();\n" cbname; - pr " if (%s_user_data == NULL) return NULL;\n" cbname; + pr " if (%s_user_data == NULL) goto out;\n" cbname; pr " nbd_...
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...+ List.iter (fun cb -> print_callback cb) cbs | _ -> () ) args; @@ -3901,10 +3907,6 @@ let print_python_binding name { args; ret } = pr " PyObject *%s; /* PyCapsule pointing to struct py_aio_buffer */\n" n; pr " struct py_aio_buffer *%s_buf;\n" n - | Callback (n, _) -> - pr " struct %s_%s_data _%s_data, *%s_data = &_%s_data;\n" name n n n n - | CallbackPersist (n, _) -> - pr " struct %s_%s_data *%s_data;\n" name n n | Flags n -> pr " uint32_t %s_u32;\n"...
2019 Jul 24
0
[PATCH libnbd 2/3] lib: Implement closure lifetimes.
...n 0;\n"; pr "}\n"; pr "\n" | _ -> () @@ -3966,7 +3952,7 @@ let print_python_binding name { args; ret } = pr " PyObject *%s; /* PyCapsule pointing to struct py_aio_buffer */\n" n; pr " struct py_aio_buffer *%s_buf;\n" n - | Closure (_, { cbname }) -> + | Closure { cbname } -> pr " PyObject *%s_user_data;\n" cbname | Flags n -> pr " uint32_t %s_u32;\n" n; @@ -4032,7 +4018,7 @@ let print_python_binding name { args; ret } = | BytesIn (n, _) | B...
2019 Jul 16
3
[RFC libnbd PATCH 0/2] Start fixing python nbd.pread_structured_callback
Posting now that I got something to compile (at the expense of breaking OCaml bindings), but I'm open to ideas on how to improve it. Eric Blake (2): generator: Tweak print_c_arg_list to take alternate first arg RFC: generator: Handle shared callbacks in Python generator/generator | 556 ++++++++++++++++++++++---------------------- 1 file changed, 280 insertions(+), 276 deletions(-) --
2019 Aug 11
4
[PATCH libnbd v2 0/3] python: Add test for doing asynch copy.
v1 was here: https://www.redhat.com/archives/libguestfs/2019-August/msg00103.html In v2 I've made several changes: - Fix Python callbacks so if they don't return something which is int-like, we assume they mean to return 0. - Add nbd.Buffer free() method. Read commit message in patch 2 to see what this is about. - Fixed the asynch copy test to deal with the unbelievably
2019 Aug 09
0
[PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...may_set_error } = (* Functions with a Closure parameter are special because we * have to generate wrapper functions which translate the * callbacks back to Python. @@ -4157,9 +4179,6 @@ let print_python_binding name { args; ret; may_set_error } = pr " struct py_aio_buffer *%s_buf;\n" n | Closure { cbname } -> pr " PyObject *%s_user_data;\n" cbname - | Flags n -> - pr " uint32_t %s_u32;\n" n; - pr " unsigned int %s; /* really uint32_t */\n" n | Int n -> pr " int %s;\n" n | Int64 n...
2019 May 28
0
[PATCH] api: Add a special type for the flags argument.
...| BytesPersistIn _ | BytesPersistOut _ | Callback _ | Flags _ | Int _ | Int64 _ | Path _ | SockAddrAndLen _ | StringList _ | UInt _ | UInt32 _ -> () ) args; @@ -3054,6 +3072,9 @@ let print_python_binding name { args; ret } = pr " struct py_aio_buffer *%s_buf;\n" n | Callback (n, _) -> pr " struct %s_%s_data callback_data;\n" name n + | Flags n -> + pr " uint32_t %s_u32;\n" n; + pr " unsigned int %s = 0; /* really uint32_t */\n" n | Int n -> pr " int %s;\n" n...
2019 Jul 24
0
[PATCH libnbd v2 2/5] lib: Implement closure lifetimes.
...pr " return ret;\n"; pr "}\n"; pr "\n" @@ -3966,7 +3951,7 @@ let print_python_binding name { args; ret } = pr " PyObject *%s; /* PyCapsule pointing to struct py_aio_buffer */\n" n; pr " struct py_aio_buffer *%s_buf;\n" n - | Closure (_, { cbname }) -> + | Closure { cbname } -> pr " PyObject *%s_user_data;\n" cbname | Flags n -> pr " uint32_t %s_u32;\n" n; @@ -4032,7 +4017,7 @@ let print_python_binding name { args; ret } = | BytesIn (n, _) | B...
2019 Jul 24
0
[PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...+ pr "}\n"; + pr "\n" | _ -> () ) args; @@ -3996,11 +3966,8 @@ let print_python_binding name { args; ret } = pr " PyObject *%s; /* PyCapsule pointing to struct py_aio_buffer */\n" n; pr " struct py_aio_buffer *%s_buf;\n" n - | Closure (false, cls) -> - pr " struct %s_user_data _user_data;\n" name; - pr " struct %s_user_data *user_data = &_user_data;\n" name - | Closure (true, cls) -> - pr " struct %s_user_data *user_data;\n" name + | Clo...
2019 Jul 25
0
[PATCH libnbd v3 1/2] lib: Implement closure lifetimes.
...pr " return ret;\n"; pr "}\n"; pr "\n" @@ -3887,7 +3872,7 @@ let print_python_binding name { args; ret } = pr " PyObject *%s; /* PyCapsule pointing to struct py_aio_buffer */\n" n; pr " struct py_aio_buffer *%s_buf;\n" n - | Closure (_, { cbname }) -> + | Closure { cbname } -> pr " PyObject *%s_user_data;\n" cbname | Flags n -> pr " uint32_t %s_u32;\n" n; @@ -3953,7 +3938,7 @@ let print_python_binding name { args; ret } = | BytesIn (n, _) | B...
2019 Aug 12
14
[PATCH libnbd 0/7] Add free callbacks and remove valid_flag.
As proposed here: https://www.redhat.com/archives/libguestfs/2019-August/msg00130.html I didn't actually read Eric's replies to that yet because I've been concentrating on writing these patches all day. Anyway here they are and I'll look at what Eric said about the proposal next. 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 May 28
2
[PATCH] api: Add a special type for the flags argument.
This applies on top of patches 1 & 2 here (instead of patch 3): https://www.redhat.com/archives/libguestfs/2019-May/msg00206.html https://www.redhat.com/archives/libguestfs/2019-May/msg00207.html Rich.
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 Aug 13
0
[PATCH libnbd 2/6] generator: Create only one Python wrapper per closure.
...pr "PyObject *\n"; pr "nbd_internal_py_%s (PyObject *self, PyObject *args)\n" name; pr "{\n"; @@ -4390,7 +4386,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = | BytesPersistIn (n, _) | BytesPersistOut (n, _) -> pr ", %s_buf->data, %s_buf->len" n n | Closure { cbname } -> - pr ", %s_%s_wrapper" name cbname; + pr ", %s_wrapper" cbname; pr ", %s_user_data" cbname | Enum (n, _) -> pr ", %s" n | Flags (n, _) -> pr ", %s_u32&...
2019 Aug 14
0
[PATCH libnbd 2/2] ocaml: Remove NBD.Buffer.free function, use the completion callback instead.
...er_data;\n" cbname; | OFlags (n, { flag_prefix }) -> pr " uint32_t %s;\n" n; pr " if (%sv != Val_int (0)) /* Some [ list of %s.t ] */\n" @@ -5120,15 +5121,16 @@ let print_ocaml_binding (name, { args; optargs; ret }) = pr " void *%s = %s_buf->data;\n" n n; pr " size_t %s = %s_buf->len;\n" count n | Closure { cbname } -> + pr " nbd_%s_callback %s_callback;\n" cbname cbname; + pr " struct user_data *%s_user_data = alloc_user_data ();\n" cbname; pr " /*...
2019 Jul 25
4
[PATCH libnbd v3 0/2] lib: Implement closure lifetimes.
I think I've addressed everything that was raised in review. Some of the highlights: - Callbacks should be freed reliably along all exit paths. - There's a simple test of closure lifetimes. - I've tried to use VALID|FREE in all the places where I'm confident that it's safe and correct to do. There may be more places. Note this is an optimization and shouldn't