From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 3E70BBB83 for ; Sat, 13 May 2006 00:59:13 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k4CMxCYJ000495 for ; Sat, 13 May 2006 00:59:12 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA32117 for ; Sat, 13 May 2006 00:59:12 +0200 (MET DST) Received: from mail.tcs.inf.tu-dresden.de (tcs01.inf.tu-dresden.de [141.76.75.1]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k4CMxB0k000490 for ; Sat, 13 May 2006 00:59:12 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.tcs.inf.tu-dresden.de (Sun Java System Messaging Server 6.1 HotFix 0.06 (built Nov 11 2004)) with ESMTP id <0IZ600I5ID6N0V00@mail.tcs.inf.tu-dresden.de> for caml-list@inria.fr; Sat, 13 May 2006 00:59:11 +0200 (MEST) Received: from tcs01.inf.tu-dresden.de ([127.0.0.1]) by localhost (mail.tcs.inf.tu-dresden.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07264-10 for ; Sat, 13 May 2006 00:59:11 +0200 (MEST) Received: from ithif59.inf.tu-dresden.de (ithif59.inf.tu-dresden.de [141.76.75.59]) by mail.tcs.inf.tu-dresden.de (Sun Java System Messaging Server 6.1 HotFix 0.06 (built Nov 11 2004)) with ESMTPS id <0IZ600H3CD6NTW10@mail.tcs.inf.tu-dresden.de> for caml-list@inria.fr; Sat, 13 May 2006 00:59:11 +0200 (MEST) Received: from tews by ithif59.inf.tu-dresden.de with local (Exim 4.50) id 1FegbH-0006bW-ID for caml-list@inria.fr; Sat, 13 May 2006 00:59:11 +0200 Date: Sat, 13 May 2006 00:59:11 +0200 From: Hendrik Tews Subject: two questions for keeping harmony (with the garbage collector) To: caml-list@inria.fr Message-id: <17509.4927.287237.266015@ithif59.inf.tu-dresden.de> MIME-version: 1.0 X-Mailer: VM 7.19 under Emacs 21.4.1 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-Virus-Scanned: amavisd-new at tcs.inf.tu-dresden.de X-Miltered: at nez-perce with ID 44651340.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4465133F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; hendrik:01 tews:01 tews:01 garbage:01 camlparam:01 camlreturn:01 pointer:01 threads:01 garbage:01 hendrik:01 heap:01 tu-dresden:01 tcs:01 intermediate:03 root:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Dear all, could somebody knowledgeable please comment on the following two points? 1. About rule 1: CAMLparam / CAMLreturn can be ommitted in the following cases: a) there is no value in the function that is a pointer to a block inside the heap. b) no allocation will take place between the start and the end of the function. (Really? Even in the presence of threads?) 2. I believe rule 2 (register with CAMLlocal) must be extended to intermediate values. Consider for instance value f(...); value g(...); ... h(f(...), g(...)); Assuming right to left evaluation, this will break if the garbage collector is called inside f, because the value returned by g is not registered as a root. However, the following is save: h2(g(...)) because h2 will register the value before any allocation can happen. Bye, Hendrik