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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A4249BBC4 for ; Mon, 24 Jul 2006 06:32:18 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k6O4WIMI028148 for ; Mon, 24 Jul 2006 06:32:18 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id GAA24177 for ; Mon, 24 Jul 2006 06:32:17 +0200 (MET DST) Received: from rabbit.math.nagoya-u.ac.jp (rabbit.math.nagoya-u.ac.jp [133.6.130.5]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k6O4WEQR028112 for ; Mon, 24 Jul 2006 06:32:16 +0200 Received: from localhost (millas [172.16.30.29]) by rabbit.math.nagoya-u.ac.jp (8.12.11/3.7W) with ESMTP id k6O4W2mq001585; Mon, 24 Jul 2006 13:32:02 +0900 (JST) Date: Mon, 24 Jul 2006 13:33:34 +0900 (JST) Message-Id: <20060724.133334.155807697.garrigue@math.nagoya-u.ac.jp> To: jonathan.roewen@gmail.com Cc: caml-list@inria.fr Subject: Re: [Caml-list] Weak module From: Jacques Garrigue In-Reply-To: <54440253999-BeMail@beos> References: <54440253999-BeMail@beos> X-Mailer: Mew version 4.0.69 on Emacs 22.0.50 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 44C44D52.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 44C44D4E.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; elt:01 bigarray:01 bigarray:01 pointers:01 pointer:01 disposed:98 wrote:01 caml-list:01 jacques:01 jacques:01 int:01 int:01 data:02 floats:02 allocated:02 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 From: "Jonathan Roewen" > For the weak module, if some value is pointing to another value which > is in a weak array, can that value be erased by the Gc still? > > e.g. type my_t = (int32, int32_elt, c_layout) Array1.t (* bigarray *) > > and I had a weak array of my_t, and was holding on to an int32 inside > the bigarray... You cannot hold on to anything inside a bigarray: this is just an array of bytes where you read and write data. A new int32 block is allocated every time you extract a value from the bigarray. Note that the same thing is true for a "float array": it is not an array of pointers to floats, but a flat array of doubles. In both cases, a pointer to the value you wrote in the array may be disposed of afterwards, if nobody else keeps it. Jacques Garrigue