[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mirage + ocaml4

Le Wed, 12 Dec 2012 11:34:04 +0000,
Anil Madhavapeddy <anil@xxxxxxxxxx> a Ãcrit :

> One performance crime that I noticed is the Cstruct.blit_string
> function, which does a byte-by-byte copy from a string to a
> Bigarray.  Pierre, do you have any thoughts on how to improve this?
> A faster blit between them would be quite useful.

Of course it is possible to do a memcopy like for copy_string. I can do
this patch later today.

I noticed that the type t is public. This may be a good idea to make it
private in the mli to avoid dangerous usage. And you should then add
with that a cast function checking that the bounds are effectively

type t = private {
  buffer: buffer;
  off : int;
  len : int;

val check: buffer -> off:int -> len:int -> t


Attachment: signature.asc
Description: PGP signature



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.