On Wed, Oct 28, 2009 at 14:54, Goswin von Brederlow <goswin-...@web.de> wrote: > Hi, > > I'm working on binding s for linux libaio library (asynchron IO) with > a sharp eye on efficiency. That means no copying must be done on the > data, which in turn means I can not use string as buffer type.
hmm I think you could try with strings. You need to allocate the storage yourself (with malloc) but then, as long as you properly set up the header and last field of the block as OCaml does for its native strings, the runtime will use it without problems. The GC will see that the block is outside the Caml heap and won't try to manage it. And on the Caml side you can use it as a regular string. The only caveat I know is that this disrupts the polymorphic comparison function a bit. That's worth a try IMO. Sylvain Le Gall <sylv...@le-gall.net> wrote: > > PS: Is a.{i} <- x a C call? > Yes. really ? Given the number of Pbigarray* constructors in the compiler code, I'd be surprised :) No I think that for some cases like "accessing a 64bits bigarray on a 32bits arch" result in a C call, but otherwise it's handled by the compiler. -- Olivier _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs