Re: ocaml inlining

From: Xavier Leroy (xleroy@pauillac.inria.fr)
Date: Wed Mar 26 1997 - 11:20:34 MET


From: Xavier Leroy <xleroy@pauillac.inria.fr>
Message-Id: <199703261020.LAA16326@pauillac.inria.fr>
Subject: Re: ocaml inlining
In-Reply-To: <199703251536.KAA12012@gulag.cs.cornell.edu> from Mark Hayden at "Mar 25, 97 10:36:15 am"
To: hayden@cs.cornell.edu (Mark Hayden)
Date: Wed, 26 Mar 1997 11:20:34 +0100 (MET)

> In the recent versions of Ocaml, are functions inlined
> across modules? Across files?

Yes to both. (Remember: this applies only to the native-code compiler.)
The body of an inlinable function is stored in the .cmx file for its
defining module, thus it can be inlined from other modules.

> If so, what is the effect of
> compiling several files with different levels of inlining?

The inlining level (-inline n) is taken into account when compiling a
function definition, but not when compiling a call to this function.
If the function is small enough (w.r.t. the inlining level at that
time), it is marked inlinable, and all uses of this function will
inline its body, regardless of the value of -inline at the time of use.

- Xavier Leroy



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:10 MET