Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Map coordinate cleanups.
Home

[Freeciv-Dev] Re: Map coordinate cleanups.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: rf13@xxxxxxxxxxxxxxxxxxxxxx, Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Map coordinate cleanups.
From: Kevin Brown <kevin@xxxxxxxxxxxxxx>
Date: Sun, 19 Aug 2001 16:22:45 -0700

Ross W. Wetmore <rwetmore@xxxxxxxxxxxx> wrote:
> At 03:24 PM 01/08/19 -0700, Kevin Brown wrote:
> >Ross W. Wetmore <rwetmore@xxxxxxxxxxxx> wrote:
> >> The total run times for an exactly identical game show an overall
> >> 25% cost (9 min vs 12 min) for functions over macros for a small
> >> set of the common ones. One could probably refine this by playing
> >> with the set to see which were the key ones.
> >
> >Hmm...yes, but is this for *regular* function calls or for *inline*
> >ones?  That's what really needs to be tested, though inline functions
> >might not be available on some of the platforms that would likely be
> >most affected by these things (the Amiga, in particular)...
> 
> I would not expect any significant difference between inline functions
> and macros. I think the issues here are of style and compatibility. 
> 
> Macros do work everywhere, inlined functions may not. 

This is something we *really* need to know.  Obviously, any platform
with gcc automatically gets inlined functions, so what remains are
those platforms that don't have it.  Of those, some will have inlined
functions but will have different ways of specifying them.  That's
what configure's for (then, of course, there are some platforms that
configure won't run on, right?  :-).

So what platforms don't have inline functions and don't have gcc,
either?  And do we even target any of them?

> There are some
> advantages to using inlined functions as they don't have quite the set
> of restrictions that macros do. There is less subjective noise in 
> arriving at suitable names for inlined functions, etc.

Right.  And they allow the compiler to do type checking (so if you
*don't* want type checking, then a macro is the way to go), and they
don't have that annoying continuation mark requirement (for multiline
macros, which is what I'm concerned about anyway), etc., etc.

If all the platforms we care about can handle inline functions, then
it becomes a matter of selecting the right tool (macro or inline
function) for the job, which is exactly the way I like it.

Are there any platforms we target that we know *for sure* can't handle
inline functions?  I thought, for instance, that even the Amiga has an
implementation of gcc available for it...


-- 
Kevin Brown                                           kevin@xxxxxxxxxxxxxx

    It's really hard to define what "unexpected behavior" means when you're
                       talking about Windows.


[Prev in Thread] Current Thread [Next in Thread]