search for: s_data

Displaying 20 results from an estimated 31 matches for "s_data".

Did you mean: i_data
2015 Jan 12
2
[LLVMdev] MCJIT handling of linkonce_odr
Hi, I'm finally moving cling to MCJIT - and MCJIT is wonderful! So far I only ran into this issue: $ cat linkonceodr.cxx extern "C" int printf(const char*,...); template <class T> struct StaticStuff { static T s_data; }; template <class T> T StaticStuff<T>::s_data = 42; int compareAddr(int* mcjit); #ifdef BUILD_SHARED int compareAddr(int* mcjit) { if (mcjit != &StaticStuff<int>::s_data) { printf("Wrong address, %ld in shared lib, %ld in mcjit!\n", (long)&St...
2016 Apr 29
3
(Orc)JIT and weak symbol resolution
...esolve weak symbols from the binary for symbols that are also llvm::Module-local. Currently, the JIT seems to favor resolving to module-local symbols over existing symbols: $ cat symbols.cxx extern "C" int printf(const char*,...); template <class T> struct StaticStuff { static T s_data; }; template <class T> T StaticStuff<T>::s_data = 42; int compareAddr(int* interp); #ifdef BUILD_SHARED int compareAddr(int* interp) { if (interp != &StaticStuff<int>::s_data) { printf("Wrong address, %ld in shared lib, %ld in interpreter!\n", (long...
2015 Jan 13
2
[LLVMdev] MCJIT handling of linkonce_odr
...> > I'm finally moving cling to MCJIT - and MCJIT is wonderful! So far I > only ran into this issue: > > $ cat linkonceodr.cxx > extern "C" int printf(const char*,...); > > template <class T> struct StaticStuff { > static T s_data; > }; > template <class T> T StaticStuff<T>::s_data = 42; > > int compareAddr(int* mcjit); > > #ifdef BUILD_SHARED > int compareAddr(int* mcjit) { > if (mcjit != &StaticStuff<int>::s_data) { > printf("Wrong ad...
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...print_c_arg_list ~handle:(Some "void *_data") cb.cbargs; + pr "\n"; + pr "{\n"; + pr " int ret;\n"; + pr " PyGILState_STATE py_save = PyGILState_UNLOCKED;\n"; + pr " PyObject *py_args, *py_ret;\n"; + pr " struct %s_data *data = _data;\n" name; + List.iter ( + function + | ArrayAndLen (UInt32 n, len) -> + pr " PyObject *py_%s = PyList_New (%s);\n" n len; + pr " for (size_t i = 0; i < %s; ++i)\n" len; + pr " PyList_SET_ITEM (py_%s, i, PyLo...
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 Jul 16
1
Re: [PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...user_data. *) > List.iter ( > function > - | ArrayAndLen _ > - | Bool _ > - | BytesIn _ > - | BytesPersistIn _ > - | BytesOut _ > - | BytesPersistOut _ > - | Callback _ -> () > - | CallbackPersist (n, _) -> > - pr " %s_data = malloc (sizeof *%s_data);\n" n n; > - pr " if (%s_data == NULL) {\n" n; > + | Closure (false, _) -> () > + | Closure (true, cls) -> > + pr " user_data = malloc (sizeof *user_data);\n"; > + pr " if (user_data == NULL) {\...
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.
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...aque %s" - name opaque_id in - match cb with - | Callback (name, _) | CallbackPersist (name, _) -> name - | _ -> assert false - in - List.iter ( 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" c...
2019 Jun 18
0
[libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...pr "extern struct nbd_handle *nbd_create (void);\n"; pr "#define LIBNBD_HAVE_NBD_CREATE 1\n"; pr "\n"; @@ -3367,6 +3380,7 @@ let print_python_binding name { args; ret } = | Int _ -> () | Opaque n -> pr " struct %s_%s_data *_data = %s;\n" name cb_name n + | ReadStatus n | String n | UInt64 n -> () (* The following not yet implemented for callbacks XXX *) @@ -3384,6 +3398,7 @@ let print_python_binding name { args; ret } = | BytesIn (n, len) -> pr " \&quot...
2019 Jun 25
3
[PATCH libnbd] generator: Add Mutable type to the generator.
...pr " PyObject *py_%s_mod = PyMapping_GetItemString (py_%s_dict, \"ctypes\");\n" n n; + pr " PyObject *py_%s = PyObject_CallMethod (py_%s_mod, \"c_int\", \"i\", *%s);\n" n n n | Opaque n -> pr " struct %s_%s_data *_data = %s;\n" name cb_name n | String n | UInt64 n -> () (* The following not yet implemented for callbacks XXX *) | ArrayAndLen _ | Bool _ | BytesOut _ - | BytesPersistIn _ | BytesPersistOut _ | Callback _ | CallbackPersist _ - | Fl...
2019 Jun 20
1
Re: [libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
..._handle *nbd_create (void);\n"; > pr "#define LIBNBD_HAVE_NBD_CREATE 1\n"; > pr "\n"; > @@ -3367,6 +3380,7 @@ let print_python_binding name { args; ret } = > | Int _ -> () > | Opaque n -> > pr " struct %s_%s_data *_data = %s;\n" name cb_name n > + | ReadStatus n > | String n > | UInt64 n -> () > (* The following not yet implemented for callbacks XXX *) > @@ -3384,6 +3398,7 @@ let print_python_binding name { args; ret } = > | BytesIn (...
2019 Jun 27
1
[libnbd PATCH] python: Fix bindings for Path parameters
...pr " * lengths for the different socket types.\n"; @@ -3699,7 +3701,7 @@ let print_python_binding name { args; ret } = | Int64 n -> pr ", &%s" n | Mutable arg -> pr ", &%s" (List.hd (name_of_arg arg)) | Opaque n -> pr ", &%s_data->data" (find_callback n) - | Path n -> pr ", PyUnicode_FSConverter, &%s" n + | Path n -> pr ", PyUnicode_FSConverter, &py_%s" n | SockAddrAndLen (n, _) -> pr ", &%s" n | String n -> pr ", &%s" n | Strin...
2019 Jun 21
0
[libnbd PATCH v2 1/5] generator: Allow Int in callbacks
...pr " for (size_t i = 0; i < %s; ++i)\n" len; pr " PyList_SET_ITEM (py_%s, i, PyLong_FromUnsignedLong (%s[i]));\n" n n - | BytesIn _ -> () + | BytesIn _ + | Int _ -> () | Opaque n -> pr " struct %s_%s_data *_data = %s;\n" name cb_name n | String n @@ -3268,7 +3269,7 @@ let print_python_binding name { args; ret } = (* The following not yet implemented for callbacks XXX *) | ArrayAndLen _ | Bool _ | BytesOut _ | BytesPersistIn _ | BytesPersistOut _ | Callbac...
2019 Jun 18
17
[libnbd PATCH 0/8] Add nbd_pread_callback
I've mentioned this topic before (in fact, the idea of adding NBD_CMD_FLAG_DF was first mentioned at [1]), but finally finished enough of an implementation to feel confident in posting it. I'd still like to add something under examples/ that uses the new API to implement strict checking of a server's structured replies read implementation (ensure that a server never sends data after
2019 Jun 20
1
Re: [libnbd PATCH 6/8] states: Add nbd_pread_callback API
...i < %s; ++i)\n" len; > pr " PyList_SET_ITEM (py_%s, i, PyLong_FromUnsignedLong (%s[i]));\n" n n > - | BytesIn _ -> () > + | BytesIn _ > + | Int _ -> () > | Opaque n -> > pr " struct %s_%s_data *_data = %s;\n" name cb_name n > | String n > @@ -3272,7 +3358,7 @@ let print_python_binding name { args; ret } = > (* The following not yet implemented for callbacks XXX *) > | ArrayAndLen _ | Bool _ | BytesOut _ > | BytesPersistIn _ | By...
2019 Jun 03
0
[PATCH libnbd discussion only 4/5] api: Implement concurrent writer.
...s = PyList_New (%s);\n" n len; pr " for (size_t i = 0; i < %s; ++i)\n" len; pr " PyList_SET_ITEM (py_%s, i, PyLong_FromUnsignedLong (%s[i]));\n" n n + | BytesIn _ -> () | Opaque n -> pr " struct %s_%s_data *_data = %s;\n" name cb_name n | String n | UInt64 n -> () (* The following not yet implemented for callbacks XXX *) - | ArrayAndLen _ | Bool _ | BytesIn _ | BytesOut _ + | ArrayAndLen _ | Bool _ | BytesOut _ | BytesPersistIn _ | Bytes...
2019 Jun 18
0
[libnbd PATCH 6/8] states: Add nbd_pread_callback API
...pr " for (size_t i = 0; i < %s; ++i)\n" len; pr " PyList_SET_ITEM (py_%s, i, PyLong_FromUnsignedLong (%s[i]));\n" n n - | BytesIn _ -> () + | BytesIn _ + | Int _ -> () | Opaque n -> pr " struct %s_%s_data *_data = %s;\n" name cb_name n | String n @@ -3272,7 +3358,7 @@ let print_python_binding name { args; ret } = (* The following not yet implemented for callbacks XXX *) | ArrayAndLen _ | Bool _ | BytesOut _ | BytesPersistIn _ | BytesPersistOut _ | Callbac...
2019 May 28
0
[PATCH] api: Add a special type for the flags argument.
...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 | Int64 n -> pr " int64_t %s_i64;\n" n; @@ -3091,6 +31...
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 Jun 21
9
[libnbd PATCH v2 0/5] nbd_pread_structured
Since v1: - rebase to applied patches - split out support for Int in callbacks - sort of test that callbacks work in OCaml (see comment in patch 5) - rename API to nbd_pread_structured - expose error as explicit parameter to callback Eric Blake (5): generator: Allow Int in callbacks states: Wire in a read callback states: Add nbd_pread_structured API states: Add tests for