From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 53D78BBCA for ; Sat, 5 Apr 2008 23:11:51 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsAAIaH90cRlBBEmmdsb2JhbACJZ4dtAQEBAQEIBQkHFpUagxE X-IronPort-AV: E=Sophos;i="4.25,609,1199660400"; d="scan'208";a="24652185" Received: from smtpoutm.mac.com ([17.148.16.68]) by mail4-smtp-sop.national.inria.fr with ESMTP; 05 Apr 2008 23:11:50 +0200 Received: from mac.com (asmtp008-s [10.150.69.71]) by smtpoutm.mac.com (Xserve/smtpout005/MantshX 4.0) with ESMTP id m35LBmrZ023503 for ; Sat, 5 Apr 2008 14:11:48 -0700 (PDT) Received: from [192.168.8.152] (c-24-218-151-219.hsd1.ma.comcast.net [24.218.151.219]) (authenticated bits=0) by mac.com (Xserve/asmtp008/MantshX 4.0) with ESMTP id m35LBkxE009772 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Sat, 5 Apr 2008 14:11:47 -0700 (PDT) Message-Id: <95154CE2-1CFC-472C-909C-60A847C457C0@mac.com> From: Gordon Henriksen To: caml-list@yquem.inria.fr In-Reply-To: Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: [Caml-list] c/OCaml interface question... Bigarray Date: Sat, 5 Apr 2008 17:11:46 -0400 References: X-Mailer: Apple Mail (2.919.2) X-Spam: no; 0.00; ocaml:01 bigarray:01 bigarray:01 stubs:01 camlparam:01 camlreturn:01 pointers:01 pointers:01 46,:98 garbage:01 wrote:01 stack:01 caml-list:01 macros:01 macros:01 On 2008-04-05, at 16:46, Andrew I. Schein wrote: > I have been looking at the Bigarray code to figure out how it =20 > works. I see in the bigarray_get_N function inside =20 > bigarray_stubs.c, that there is no use of macro CAMLParam* or =20 > CAMLReturn. How is it that these macros are unnecessary in this code? These macros allow the garbage collector find and update pointers on =20 the stack. Without them, the GC might collect the referenced objects, =20= leaving dangling pointers in stack-local variables. The use of these =20 macros is unnecessary overhead if (1) the collector cannot be invoked =20= from the function (that is, no GC memory is allocated from it) or (2) =20= there are no object references kept in parameters or local variables. =97 Gordon