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
[Caml-list] register_global_root, malloc, etc.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-08-16 (00:58)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] register_global_root, malloc, etc.

>I can't understand who will delete `foo *', allocated via `foo *p = new

free_foo unregisters the roots pointing inside foo, and then deletes foo.  The GC will deallocate the abstract object itself.

> As I understood from the manual, Custom_tag is the only way to
>assign free_foo with the resulting Caml object.

Custom means the object gets a finalization call from the gc.  Abstract means there's no finalization.  I should be using Custom so my foo doesn't leak.


Bug reports:  FAQ:
To unsubscribe, mail  Archives: