Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: (PR#2370) Path finding
Home

[Freeciv-Dev] Re: (PR#2370) Path finding

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#2370) Path finding
From: "Raimar Falke via RT" <rt@xxxxxxxxxxxxxx>
Date: Sun, 24 Nov 2002 13:02:58 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, Nov 24, 2002 at 12:29:49PM -0800, Gregory Berkolaiko via RT wrote:
> 
> On Sun, 24 Nov 2002, Raimar Falke via RT wrote:
> 
> > On Sun, Nov 24, 2002 at 12:05:11PM -0800, Gregory Berkolaiko via RT wrote:
> > > > > > Fourth: how general/special do we want the queue implementation. If 
> > > > > > we
> > > > > > for example typedef that the queue works on shorts (16bit, less
> > > > > > memory) instead of void pointers or int we can get some speed. 
> > > > > > However
> > > > > > this makes the queue not general. Also critical (see point 1) is the
> > > > > > inlining of the queue functions.
> > > > > 
> > > > > I don't believe memory use by queue is significant.  There is also 
> > > > > another 
> > > > > customer for this queue, airgoto.c, but it also uses ints (can be 
> > > > > shorts) 
> > > > > right now.
> > > > 
> > > > Inlining of queue functions?
> > > 
> > > Yes, it introduces speedup, about 5%
> > 
> > Hehe. I got you ;). Inlining the queue functions via macros is dead
> > ugly.
> 
> :)))
> 
> But I never said anything against inlining!  You are probably confusing me 
> with someone else!

You were using and defending macros. Do you must be against inlines ;)

> But inlining can only be done within one file, isn't it?

The compiler has to see the code. Either you inline methods of your
file or you put the function body in some file you include (.h for
example). The latter is used a lot in the linux kernel. So the file
dcache.h for example contains functions like:

/* partial hash update function. Assume roughly 4 bits per character */
static __inline__ unsigned long partial_name_hash(unsigned long c, unsigned 
long prevhash)
{
        return (prevhash + (c << 4) + (c >> 4)) * 11;
}

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "How about the new language C&? No, that's not 'c ampersand', 'c reference', 
  'reference to c' or 'c and'. It's pronounced 'campersand', to confuse the 
  hell out of people who are unfamiliar with it, and it will, of course, 
  have no pointers."
    -- Xazziri in comp.lang.c++ about C#



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