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.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 EEF1ABC6C for ; Mon, 4 Feb 2008 12:11:33 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJKBpkfB/BYfhWdsb2JhbACQKQEBAQgCCAcIEweaEw X-IronPort-AV: E=Sophos;i="4.25,302,1199660400"; d="scan'208";a="22148762" Received: from smtp20.orange.fr ([193.252.22.31]) by mail4-smtp-sop.national.inria.fr with ESMTP; 04 Feb 2008 12:11:33 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2022.orange.fr (SMTP Server) with ESMTP id 011B81C0005A for ; Mon, 4 Feb 2008 12:11:33 +0100 (CET) Received: from [192.168.1.59] (APuteaux-154-1-58-91.w81-249.abo.wanadoo.fr [81.249.65.91]) by mwinf2022.orange.fr (SMTP Server) with ESMTP id 9F77D1C00078; Mon, 4 Feb 2008 12:11:32 +0100 (CET) X-ME-UUID: 20080204111132653.9F77D1C00078@mwinf2022.orange.fr Message-ID: <47A6F2E5.2000604@frisch.fr> Date: Mon, 04 Feb 2008 12:11:33 +0100 From: Alain Frisch User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Jon Harrop Cc: caml-list Subject: Re: [Caml-list] Using OCaml's run-time from LLVM-generated native code References: <200802012124.56835.jon@ffconsultancy.com> <200802032319.15846.jon@ffconsultancy.com> <47A6B8B5.9010907@frisch.fr> <200802041032.05929.jon@ffconsultancy.com> In-Reply-To: <200802041032.05929.jon@ffconsultancy.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; frisch:01 frisch:01 ocaml's:01 run-time:01 val:01 wrote:01 caml-list:01 int:01 int:01 fib:01 fib:01 alain:01 alain:01 caml:02 native:03 Jon Harrop wrote: > Despite the availability of that code it seems that few people can use it > correctly and I am one of them. What part of memory.h do you fail to understand? > int apply(int n) { > CAMLlocal2(nv, fibn); > nv = copy_int64(n); > fibn = fib(nv); > caml_gc_full_major(0); > return Int64_val(fib(nv)); > } > > Is that correct code? No, this function does not follow the rules of Section 18.5.1. -- Alain