Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Garbage collecting _everything_
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Garbage collecting _everything_
Maybe I wasn't clear enough, sorry.

> Suppose you have this definition in a module
>
> let x = (1.0, 2.0)

and this one

let f () = x

You cannot garbage collect x since at any time function f may be 
called. For example

  at_exit (fun () -> Gc.full_major; ignore (f ())) ;;

Daniel

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners