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
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
sayan@crans.org 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