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
[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: 2002-07-08 (14:21)
From: Olivier Andrieu <andrieu@i...>
Subject: Re: [Caml-list] finalizing bigarrays
 Fernando Alegre [Monday 8 July 2002] :
 > 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.

How about defining

  external finalise_my_bigarray : ('a, 'b, 'c) Bigarray.Genarray.t -> unit

and then using

  Gc.finalise ?

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: