[Freeciv-Dev] Re: Map coordinate cleanups.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> I haven't looked at the assembler output but is possible that the
> compiler removes the loop completely. The actual execution times
> however are too large for a body without the loop.
I'm quite sure the compiler didn't optimize the loop out, otherwise
execution would have been instantaneous. In other words, what you
said. :-)
> > > Besides, compilers can't optimize functions as well as inlined code.
> >
> > Is this true of inlined functions? I have suspicions that it is. I'm
> > not sure how to devise a testcase for this...
>
> AFAIK the current compilers can only inline methods if the compiler
> sees the method body at compile time. This leads to such ugly header
> files as seen in some C++ code.
Not much difference between that and macros, is there? Especially
macros of the variety we're talking about. There's no problem with
namespaces, either: just declare the functions static in the headers
(but we all knew this already, so why am I saying it? :-).
I'd argue that, even if the function is in the header, it's *still*
cleaner looking than the equivalent macro (for multiline macros, at
least), if only because the macro has to have a continuation character
after each line.
This stuff only becomes an issue when you're dealing with a compiler
that can't do inline functions. I doubt there are many of those that
matter anymore...
--
Kevin Brown kevin@xxxxxxxxxxxxxx
It's really hard to define what "unexpected behavior" means when you're
talking about Windows.
[Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Jason Dorje Short, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Vasco Alexandre Da Silva Costa, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups.,
Kevin Brown <=
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/19
[Freeciv-Dev] Re: Map coordinate cleanups., Tony Stuckey, 2001/08/17
[Freeciv-Dev] Re: Map coordinate cleanups., Vasco Alexandre Da Silva Costa, 2001/08/17
[Freeciv-Dev] Re: Map coordinate cleanups., Justin Moore, 2001/08/17
[Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/17
[Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/19
[Freeciv-Dev] Re: Map coordinate cleanups., Ross W. Wetmore, 2001/08/19
[Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/19
|
|