From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!ads.com!saturn!bhanafee From: bhanafee@deimos.ads.com (Brian Hanafee) Newsgroups: comp.lang.ada Subject: Re: Use pragma INLINE or not? Message-ID: Date: 19 Jun 91 15:57:03 GMT References: <1991Jun18.171459.11744@software.org> Sender: usenet@ads.com (USENET News) Organization: Advanced Decision Systems, Mountain View, CA 94043, +1 (415) 960-7300 In-Reply-To: stluka@neptune.software.org's message of 18 Jun 91 17:14:59 GMT List-Id: In article <1991Jun18.171459.11744@software.org>, stluka@neptune.software.org (Fred Stluka) writes: > There seem to be 2 schools of thought: > > 1) Don't use it. Smart compilers will automatically > inline the most appropriate routines. > > 2) Use it. Compilers aren't that smart yet. > > What do you think? 3) "A pragma is used to convey information to the compiler." Use it when you know something about the code that the compiler doesn't know. In the case of case of pragma INLINE, this shouldn't happen very often. It might be appropriate for short library routines (such as math vector operations) which you might expect to find in hot spots such as inner loops. Generally, pragma ELABORATE (unit_you_want_inlined) followed by pragma OPTIMIZE (time) in the calling unit is more appropriate. Brian Hanafee