Version française
Home     About     Download     Resources     Contact us    
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).

Chris

-------------------
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