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: 2003-06-02 (16:21)
From: Harry Chomsky <harry@c...>
Subject: Re: [Caml-list] Question about register_global_root
Damien Doligez wrote:
> On Sunday, June 1, 2003, at 12:50 PM, Maas-Maarten Zeeman wrote:
> > The manual explicitly tells that register_global_root should be called
> > before any valid value is stored in it for the first time, like
> > Val_unit. See Rule 4 of Interfacing C with Objective Caml in the
> > manual.
> I'm afraid Chris is right and the manual is wrong.
> [...]
> You must store a valid value before the first allocation that follows
> register_global_root.

I think that both Chris and the manual are right.  The manual actually
instructs the programmer to register a global root v "just before a valid
value is stored in v for the first time".  Key word: "just".  In other
words, as Damien says, no allocations are allowed between registration and
storing a value.

Apparently more than one reader of the manual has missed this detail.  Would
it be clearer to say "immediately before" instead of "just before"?

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