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
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
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
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
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
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