Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] finalizing bigarrays
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Fernando Alegre <fernando@c...>
Subject: [Caml-list] finalizing bigarrays

Are there any plans to add a "finalize" function to externally managed
bigarrays?

We have a C library that allocates bigarrays in a certain complex way and
needs to deallocate them when the bigarrays are no longer in use. We have
thought of several ways to do this, but neither is optimal, except the last
one:

1) Wrap the bigarray in a custom type that we need to drag along with it
   all the time. The finalizer in the custom type will then deallocate the
   bigarray.
   
2) Do without bigarrays, and move some code from Caml to C.

3) Copy the bigarray source code (bigarray_stubs.c) and modify it to accept
   an external finalizer. We would still use bigarrays, so that compiler
   optimizations are performed.
   
4) Ask the OCaml developers to add a way to finalize bigarrays... :-)

So... any chance this will be added in the next release?

Thank you,

      Fernando
      
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners