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] Question about register_global_root
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] Question about register_global_root

>  signal_handlers = alloc(NSIG, 0);
>  register_global_root(&signal_handlers);
>Is this also allowed?

If signal_handlers is CAMLlocal (or equivalent).  Although since 
register_global_root doesn't [currently] call the gc, it's probably okay as 
is, but why risk it?

Perhaps all of the c-callable runtime functions should have a special 
prefix or suffix if they can cause a collection, and then the docs can be 
clear about what you can do before/after/between/whatever these specially 
marked calls.  Of course, then you'd have to transition everybody to the 
new calls, which is a pain (or you could make it an #ifdef in the headers 
like STRICT on win32).


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: