On Thu, 04 Aug 2011 16:52:20 +0200
Oto Havle <[email protected]> wrote:

>    I've found a thread from caml-list archives which suggests that calling 
> caml_{register/remove}_global_root from custom block finalizers might not be 
> safe:
> 
> http://www.mail-archive.com/[email protected]/msg03746.html
> 

No, this is not the case, quoting Xavier Leroy from that same thread:

> I foresee absolutely no problems with registering/unregistering global
> roots from a C finalizer.  As the manual states, the big no-no in
> C functions attached to custom blocks is allocating in the heap,
> either directly or via a callback into Caml or by releasing the global
> lock.  Within a finalizer, you should also refrain from raising an
> exception, as this would leave the GC is a bizarre state.  But global
> roots operations are OK.

-- 
 ygrek
 http://ygrek.org.ua/



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to