delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/30/21:49:38

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Inlining
Date: Fri, 30 Jan 1998 19:19:20 -0500
Organization: Two pounds of chaos and a pinch of salt.
Lines: 32
Message-ID: <34D26C6A.DB8@cs.com>
References: <34D23EAA DOT 3609B2B AT worldonline DOT nl>
NNTP-Posting-Host: ppp229.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Reinier Heeres wrote:
> 
> I have the idea that DJGPP isnt't inlining my hline routine in my
> program, but I have defined it like this:
> 
> inline void hline(int x1,int x2,int y,unsigned char c)
> 
> and I compile and link with the -finline-fnuctions flag...
> 
> Does anybody have an idea how this might happen (the functions that call
> hline() are in the same module)

The compiler has the ultimate discretion as to whether a given function
merits inlining or not.  There are various criteria (see "info gcc "c
extensions" inline"), but gcc may well have decided that your hline()
function is too complex to be inlined, and therefore refuses to do it. 
Without seeing the actual code, there's no way to be absolutely certain.

If you want to test whether hline() is being inlined, you can instruct
the compiler to stop before the assembly stage, and output an assembly
language file, with the '-S' option.  Looking over this should tell you
what you need to know.

hth!

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |     mailto:fighteer AT cs DOT com     |
| "Starting flamewars since 1993"  |   http://www.cs.com/fighteer/  |
|  *** NOTICE ***  This .signature |       ICQ UIN#:  7406319       |
|  is generated randomly.  If you don't like it, sue my computer.   |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019