English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis ŕ jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml ŕ l'adresse ocaml.org.

Browse thread
Big array with data managed by another value
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-11-14 (14:43)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Big array with data managed by another value

Le 14 nov. 08 ŕ 15:03, Romain Beauxis a écrit :

> We can pass the CAML_BA_EXTERNAL flag to the bigarray, so that the  
> Gc doesn't
> touch data pointer when deallocating the returned array.
> However, what I don't know how to do yet is to also tell the Gc that  
> the
> original value should not be deallocated until we have finished  
> dealing with
> the returned bigarray.
> Is there a clean way to do that ?

I'm not sure I understand what you want to do (what is the original  
value ?).

1) If you are wondering about the original data of the allocated big  
array then there is no such data if you use alloc_bigarray with  
2) If you are wondering about how you could deallocate the C pointer  
using your own function whenever the bigarray becomes unreachable then  
register the bigarray with Gc.finalise and an appropriate function.