From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA13491; Fri, 23 Mar 2001 16:59:18 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 QAA13354 for ; Fri, 23 Mar 2001 16:59:17 +0100 (MET) Received: from miss.wu-wien.ac.at (miss.wu-wien.ac.at [137.208.107.17]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f2NFxGX10261; Fri, 23 Mar 2001 16:59:16 +0100 (MET) Received: (from mottl@localhost) by miss.wu-wien.ac.at (8.9.0/8.9.0) id QAA06550; Fri, 23 Mar 2001 16:59:15 +0100 (MET) Date: Fri, 23 Mar 2001 16:59:15 +0100 From: Markus Mottl To: Xavier Leroy Cc: caml-list@inria.fr Subject: Re: [Caml-list] Inline assembly? Message-ID: <20010323165915.A2990@miss.wu-wien.ac.at> References: <20010322142826.B18008@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010322142826.B18008@pauillac.inria.fr>; from Xavier.Leroy@inria.fr on Thu, Mar 22, 2001 at 14:28:26 +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 22 Mar 2001, Xavier Leroy wrote: > Yes. Since the C function will not heap-allocate nor raise > exceptions, you can tell the compiler about it using the "noalloc" > annotation: > > external myfunction : ... = "myfunction" "noalloc" > > and this will select a faster calling convention from Caml to C for > this function. If the function operates over floats, there are other > performance tricks one can play; write me if this is the case. I have some functions that return floats in the LAPACK-interface. They could (slightly) benefit from more appropriate calling conventions. If I am not mistaken, it is not ok to use "noalloc" if the C-function uses "copy_double", because the latter could trigger the GC. If the function returns a float, it seems that the additional annotation "float" could be applied, but it is obviously not always used in the Pervasives library (e.g. float_of_string; ld_exp). Is this just an oversight or do these functions have other properties that prevent the use of this annotation? Are there special rules to follow? Best regards, Markus Mottl -- Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr