Version française
Home     About     Download     Resources     Contact us    
Browse thread
Freeing allocated C-memory by GC (destructors)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Oliver Bandel <oliver@f...>
Subject: Freeing allocated C-memory by GC (destructors)
Hello,

after using some non-permanent allocating C-stuff
together with OCaml, I think about going one step further and
now have allocated memory from C represented as OCaml-variables
(in the concrete example I have married some of my C-stuff that
uses jpeglib to get information from picture-files, and
now think about representing complete picture-data as
OCaml-variables).

So, I want to have the possibility to have malloced/calloced
data avaliable in OCaml, and that the GC calls C-destructor-
functions (using free(3)) when the values are of no use anymore.


How to say the GC, which is the destructor-functions
for a variable, which has been created?

TIA,
   Oliver