search for: mutable

Displaying 20 results from an estimated 369 matches for "mutable".

2019 Jun 25
3
[PATCH libnbd] generator: Add Mutable type to the generator.
Mutable (Int n) => int *n This can currently only be used for callback arguments of type int (not for other types, nor for any ordinary function arguments), but it could be implemented more generally in future. --- generator/generator | 75 +++++++++++++++++++++++++++++++++++++-------- 1 file changed,...
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...Callback of string * arg list (* callback function returning int *) -| CallbackPersist of string * arg list (* as above, but callback persists *) | Flags of string (* NBD_CMD_FLAG_* flags *) | Int of string (* small int *) | Int64 of string (* 64 bit signed int *) | Mutable of arg (* mutable argument, eg. int* *) -| Opaque of string (* opaque object, void* in C *) +| OpaqueAndCallbacks of string * callback list (* one or more callbacks + * sharing same opaque *) +| OpaqueAndCallbacksPersist of string * c...
2019 Jun 29
0
[libnbd PATCH 3/6] generator: Allow Int64 in callbacks
...name { args; ret } = 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 _ - | Int _ -> () + | Int _ + | Int64 _ -> () | Mutable (Int n) -> pr " PyObject *py_%s_modname = PyUnicode_FromString (\"ctypes\");\n" n; pr " if (!py_%s_modname) { PyErr_PrintEx (0); return -1; }\n" n; @@ -3525,7 +3526,7 @@ let print_python_binding name { args; ret } = | ArrayAndLe...
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 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
...and quite a bit of unreachable code (eg. Python code for handling ArrayAndLen in normal methods that was never used). The output of the generator after this commit should be identical. It's possible to go a little further if we wanted: CBArrayAndLen is only ever used for ‘uint32_t’ arrays. CBMutable is only ever used for ‘int*’. We could make CB* types which only handle those cases. --- generator/generator | 428 +++++++++++++++++++------------------------- 1 file changed, 186 insertions(+), 242 deletions(-) diff --git a/generator/generator b/generator/generator index 51f2a47..88c8fef 10075...
2019 Jul 24
0
[PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...t;offset"; Closure (false, - [{ cbname="chunk"; - cbargs=[BytesIn ("subbuf", "count"); - UInt64 "offset"; Int "status"; - Mutable (Int "error")] }]); + { cbname="chunk"; + cbargs=[BytesIn ("subbuf", "count"); + UInt64 "offset"; Int "status"; + Mutable (Int "...
2019 Jul 24
0
[PATCH libnbd v2 5/5] lib: Use unsigned for pread_structured status parameter.
...="chunk"; cbargs=[BytesIn ("subbuf", "count"); - UInt64 "offset"; Int "status"; + UInt64 "offset"; UInt "status"; Mutable (Int "error")] }; Flags "flags" ]; ret = RErr; @@ -1751,7 +1751,7 @@ cause a deadlock."; Closure { cbname="chunk"; cbargs=[BytesIn ("subbuf", "count"); UIn...
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...acks persist + in the handle, false means they only + exist during the function call *) | Flags of string (* NBD_CMD_FLAG_* flags *) | Int of string (* small int *) | Int64 of string (* 64 bit signed int *) | Mutable of arg (* mutable argument, eg. int* *) -| Opaque of string (* opaque object, void* in C *) | Path of string (* filename or path *) | SockAddrAndLen of string * string (* struct sockaddr * + socklen_t *) | String of string (* string *) @@ -863,6 +864,10 @@ and...
2019 Jul 16
2
[PATCH libnbd] generator: Define new Closure type
** INCOMPLETE ** This is the generator change as discussed on the list already. The Python and OCaml bindings are not yet done. It passes all [C only] tests and valgrind. Note that nbd_add_close_callback is inconsistent with other closure types because it passes the user_data parameter after the function. (This is not caused by the current patch, it was already inconsistent). We decided that
2017 Aug 09
0
[PATCH v12 08/11] daemon: Implement inspection types and utility functions.
...+and location = { + mountable : Mountable.t; (** The device name or other mountable object.*) + vfs_type : string; (** Returned from [vfs_type] API. *) +} + +and role = + | RoleRoot of inspection_data + | RoleUsr of inspection_data + | RoleSwap + | RoleOther +and inspection_data = { + mutable os_type : os_type option; + mutable distro : distro option; + mutable package_format : package_format option; + mutable package_management : package_management option; + mutable product_name : string option; + mutable product_variant : string option; + mutable version : version option; + mut...
2023 Mar 07
1
[PATCH v2v] convert: Allow preferred block driver to be specified on the command line
...quot;vrtioblk"; "viostor"] in >> "common/mlcustomize/inject_virtio_win.ml" would be replaced with a >> reference cell, and get_block_driver_priority / >> set_block_driver_priority would manipulate that. > > References are really just structures with mutable fields and some > syntactic sugar: > > https://github.com/ocaml/ocaml/blob/66db964f48869c6470b8ccd1ed672e244ba9d680/stdlib/stdlib.ml#L237 > > The reason mutable fields of structures in general have to be > specially marked with the "mutable" keyword is because of the &...
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 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 30
3
[PATCH libnbd] lib: Remove cookie parameter from completion callbacks.
...b/generator/generator @@ -1729,7 +1729,7 @@ C<nbd_pread>."; default_call with args = [ BytesPersistOut ("buf", "count"); UInt64 "offset"; Closure { cbname="callback"; - cbargs=[Int64 "cookie"; Mutable (Int "error")] }; + cbargs=[Mutable (Int "error")] }; Flags "flags" ]; ret = RInt64; permitted_states = [ Connected ]; @@ -1737,8 +1737,11 @@ C<nbd_pread>."; longdesc = "\ Issue a read command to the N...
2006 Mar 09
1
Mutable models based on dbfunctions or stored procs?
Is there any way that a model can be based on a stored procedure or function that so that it can return a set of data based on a parameter provided in either the controller, or s a variable in the model? That way you could: 1) Set the variable 2) Call find_all 3) Get a mutable set of results that takes better advantage of some of the advanced database features available? There are many times when SQL code is simply a better way to twist and turn data sets. (Olap transformations, speeding up joins in large tables by using temp tables, etc.) Best, Brian ---------...
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
2005 Feb 24
2
mutable Query objects
...re(db); // make a simple query Xapian::Query myquery(Xapian::Query::OP_NEAR, phrase, phrase + 2); enquire.set_query(myquery); // Now change the query - this shouldn't affect the query enquire // will run, but it does. myquery.set_window(10); The essential issue here is that queries are mutable, so Enquire::set_query() needs to clone the Query object to stop it being changed behind the scenes. I can see two fixes for this: (a) implement a "deep copy" clone for Query objects and use it in Enquire::set_query() (b) make Query object immutable by replacing these non-const public...
2019 Jun 25
0
Re: [PATCH libnbd] generator: Add Mutable type to the generator.
On 6/25/19 12:11 PM, Richard W.M. Jones wrote: > Mutable (Int n) => int *n > > This can currently only be used for callback arguments of type int > (not for other types, nor for any ordinary function arguments), but it > could be implemented more generally in future. > --- > generator/generator | 75 ++++++++++++++++++++++++++++++++...
2008 Feb 19
1
level of mutability for the type of a SEXP
..., I am writing C code to interface with R, and I would like to know the level of mutability for the type of a SEXP. I see that there is a macro/function TYPEOF(), and that it can be used as an l-value, as well as a macro/function SET_TYPEOF(). My question is "should the type be considered immutable, or it can it change after the SEXP has been created and used for a while ?". I understand that a call to TYPEOF will not perform any conversion, and my question is only about being sure that once the type of a given SEXP is set it cannot change. Laurent
2019 Jul 24
0
[PATCH libnbd 2/3] lib: Implement closure lifetimes.
..."offset"; - Closure (false, - { cbname="chunk"; - cbargs=[BytesIn ("subbuf", "count"); - UInt64 "offset"; Int "status"; - Mutable (Int "error")] }); + Closure { cbname="chunk"; + cbargs=[BytesIn ("subbuf", "count"); + UInt64 "offset"; Int "status"; + Mutable (Int "error...