From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA03944; Mon, 8 Jul 2002 15:28:04 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA03694 for ; Mon, 8 Jul 2002 15:28:03 +0200 (MET DST) Received: from gato.phys.clemson.edu (gato.phys.clemson.edu [130.127.188.133]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g68DS2P14953 for ; Mon, 8 Jul 2002 15:28:02 +0200 (MET DST) Received: from adsl-78-167-177.gsp.bellsouth.net ([216.78.167.177] helo=elefante.local) by gato.phys.clemson.edu with asmtp (Exim 3.35 #1 (Debian)) id 17RYYa-0005tk-00; Mon, 08 Jul 2002 09:28:00 -0400 Received: from oso.local ([192.168.1.3]) by elefante.local with esmtp (Exim 3.35 #1 (Debian)) id 17RYYi-0001NC-00; Mon, 08 Jul 2002 09:28:08 -0400 Received: from fernando by oso.local with local (Exim 3.35 #1 (Debian)) id 17RYZ4-0003eL-00; Mon, 08 Jul 2002 09:28:30 -0400 Date: Mon, 8 Jul 2002 09:28:30 -0400 To: caml-list@inria.fr Subject: [Caml-list] finalizing bigarrays Message-ID: <20020708132830.GA14019@oso.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i From: Fernando Alegre Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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