English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
problem creating .cma library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-01-20 (14:42)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] problem creating .cma library

On 2010-01-09, at 20:29, Guillaume Yziquel wrote:

> The remembere set, in this context, explains why I would need  
> Store_field when dealing with pure OCaml world. When wrapping  
> pointers to the C heap in abstract blocks, I do not see the point of  
> Store_field, and it seems to me that Field= assignment is fine. Am I  
> mistaken?

When assigning into an Abstract block, Store_field is not needed.
Moreover, when assigning or overwriting a non-pointer in an Abstract
block, Store_field is forbidden.  So you'd better never use it to
assign into an Abstract block.

A trick to remember it: the contents of an Abstract block is not
fields as far as the GC is concerned.

> I assume that caml_local_roots gets restored by a mechanism in the  
> 'try' of the 'try / with' construct after the siglongjmp of  
> caml_raise.
> Therefore it should be OK to use caml_raise_with_args before  
> End_roots().
> Am I right, or is this plainly wild guessing?

Your wild guessing is correct (line 249 of interp.c).

-- Damien