Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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 (15:11)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Big array with data managed by another value

Le 14 nov. 08 à 15:42, Daniel Bünzli a écrit :

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

I think I understood now, the original value was the custom block.

If you were using the custom block only for finalization issues (not  
serialization, hashing etc.) then one solution would be to replace  
your custom block type by the bigarray itself. An register the  
bigarray with Gc.finalise to deallocate the C pointer at the  
appropriate time. Then you have

type t = bigarray
let to_bigarray x = x

and no problems.