Re: [Xen-devel] [PATCH for-4.11 0/2] xenstore: reduce use of unsafe conversions

2018-05-31 Thread Marcello Seri
On 31/05/18 17:29, Juergen Gross wrote: >On 31/05/18 16:49, Andrew Cooper wrote: >> On 31/05/18 15:14, Juergen Gross wrote: >>> On 31/05/18 15:05, Marcello Seri wrote: >>>> When xenstore was updated to support safe-string, some unnecessary >>>> copies we

[Xen-devel] [PATCH for-4.11 2/2] ocaml/xenstored: reduce use of unsafe conversions

2018-05-31 Thread Marcello Seri
The rationalisation of the Xs_ring interface in the xb library allows to further reduce the unsafe calls withouth introducing copies. This patch also contains some further code cleanups. Signed-off-by: Marcello Seri --- tools/ocaml/xenstored/logging.ml | 16 ++-- tools/ocaml

[Xen-devel] [PATCH for-4.11 1/2] ocaml/libs/xb: use bytes in place of strings for mutable buffers

2018-05-31 Thread Marcello Seri
rationalised mimicking the new Unix module in the standard library (the implementation of Unix.write_substring uses unsafe_of_string in the exact same way, and both the write implementations are using the bytes as an immutable payload for the write). Signed-off-by: Marcello Seri --- tools/ocaml/libs/xb

[Xen-devel] [PATCH for-4.11 0/2] xenstore: reduce use of unsafe conversions

2018-05-31 Thread Marcello Seri
patch introducing the unsafe conversion with some version of the ocaml compiler. Marcello Seri (2): ocaml/libs/xb: use bytes in place of strings for mutable buffers ocaml/xenstored: reduce use of unsafe conversions tools/ocaml/libs/xb/xb.ml| 12 +--- tools/ocaml/libs/xb/xb.mli

[Xen-devel] [PATCH 0/1] Reduce copies between ocaml Strings and Bytes

2018-04-05 Thread Marcello Seri
the ownership of the bytes is clear. For reference see https://caml.inria.fr/pub/docs/manual-ocaml/libref/Bytes.html#3_Unsafeconversionsforadvancedusers This patch replaces the conversion functions with unsafe conversions when possible. Marcello Seri (1): tools: reduce copies b/w ocaml Strings and

[Xen-devel] [PATCH 1/1] tools: reduce copies b/w ocaml Strings and Bytes

2018-04-05 Thread Marcello Seri
is safe to use the unsafe functions and prevent a copy. This patch updates the code to use the unsafe conversions where possible. Signed-off-by: Marcello Seri --- tools/ocaml/libs/xb/xb.ml| 4 +++- tools/ocaml/xenstored/logging.ml | 8 +--- tools/ocaml/xenstored/stdext.ml | 2