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
Documentation request: allocation of bigarrays in C
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-03-31 (17:59)
From: Dmitry Bely <dbely@m...>
Subject: Re: [Caml-list] Documentation request: allocation of bigarrays in C writes:

> Please add the following fact to the Bigarray module documentation (I
> had to look at the c source header) and/or correct it as necessary :
> A pointer allocated from C using malloc is not freed by the OCaml
> garbage collector.

Of course - it's not possible in general.

> If you want to be GC-friendly, use the bigarray
> allocation macros with a NULL pointer to allocate memory then get a
> pointer to the data array.

If you need GC-controlled bigarray, why simply not to use

- Dmitry Bely