English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
ocaml inlining
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1997-03-26 (13:07)
From: Xavier Leroy <xleroy@p...>
Subject: Re: ocaml inlining
> 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