From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id E55C5BBAF for ; Wed, 20 Jan 2010 15:42:07 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.49,310,1262559600"; d="scan'208";a="41836828" Received: from macabane.inria.fr ([128.93.8.160]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 20 Jan 2010 15:42:07 +0100 Cc: caml-list List Message-Id: <1E7D405B-3768-43E5-B304-E32CEBFB56D4@inria.fr> From: Damien Doligez To: guillaume.yziquel@citycable.ch In-Reply-To: <4B48D912.8090602@citycable.ch> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Caml-list] problem creating .cma library Date: Wed, 20 Jan 2010 15:42:07 +0100 References: <56670.41.177.16.252.1262195331.squirrel@41.177.16.252> <4B3BE288.4030701@citycable.ch> <3EE07409-9559-4B91-BA3E-8787D1378275@inria.fr> <4B47C201.7090201@citycable.ch> <4B47C59C.9080505@starynkevitch.net> <4B47C9BE.4060309@citycable.ch> <001f01ca9101$7ee76850$7cb638f0$@romulus.metastack.com> <4B486974.7060007@citycable.ch> <20100109125224.GC26610@annexia.org> <4B48D912.8090602@citycable.ch> X-Mailer: Apple Mail (2.936) X-Spam: no; 0.00; damien:01 damien:01 guillaume:01 ocaml:01 pointers:01 interp:01 'try:98 doligez:01 doligez:01 wrote:01 abstract:01 abstract:01 heap:01 caml-list:01 cma:01 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