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
Disabling the OCaml garbage collector
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-11-28 (18:24)
From: Thomas Fischbacher <tf@f...>
Subject: Re: [Caml-list] Disabling the OCaml garbage collector
Alain Frisch wrote:

>> The issue for me is that I need to be able to modify mutable objects 
>> in OCaml (eg. array-modification in-place) from both OCaml and 
>> C/Python. However, the OCaml GC moves things around while the 
>> execution is in C/Python and this crashes my program.
> Are you sure?
> The OCaml GC is triggered only when Caml memory blocks are allocated 
> (from Caml or C code) or when you call it explicitly.

Most likely, he calls back into another OCaml function from Python which
does some memory allocation... In real applications, this situation is
practically impossible to avoid.

best regards,
Thomas Fischbacher