caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Alternative allocation of bigarrays
@ 2005-02-20 19:38 Christophe TROESTLER
  0 siblings, 0 replies; only message in thread
From: Christophe TROESTLER @ 2005-02-20 19:38 UTC (permalink / raw)
  To: O'Caml Mailing List

Hi,

I am interfacing OCaml with a C library that needs special allocation
functions for full speed (for alignment reasons).  I am wondering
about the best course to follow to create bigarrays with these new
malloc/free functions.

What I am doing now is to define a special "bigarray_create" based on
a spacial "alloc_bigarray" using tailored custom_operations.
Specifically, "alloc_bigarray" uses the new malloc and
"bigarray_finalize" of the "custom_operations" use the new free.  So
far I suppose there is no problem and they can share the OCaml
Bigarray types.  However I also changed the "custom_operations"'s
"identifier" and "bigarray_deserialize" so these bigarrays are
deserialized with the new malloc.  Can I still use the standard
bigarray types with these new arrays ?  (I would guess so but I'd like
a confirmation here.)

Also, if better approaches are possible, I will be happy to know them.
(The current solution requires to duplicate a lot of bigarray.c code.)

Regards,
ChriS


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-20 19:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-20 19:38 Alternative allocation of bigarrays Christophe TROESTLER

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).