Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: C++ question (OT)

Author: David Blackman

Date: 22:26:15 01/18/01

Go up one level in this thread


On January 18, 2001 at 18:22:21, David Rasmussen wrote:

>Would there be any downside to the inline function?

Some compilers might decide to treat it as a normal function instead of inlining
it, in some cases. I think Borland does this if the inline function contains
loops or other things it considers "too complex".

Also GCC for a while was doing much better register allocation for macros than
inline functions. I have no idea why, but it probably counts as a bug. I haven't
checked recently to see if it is fixed yet.

I wouldn't worry about either of these unless the inline function turns out to
be accounting for a large fraction of the runtime of the whole program. Inline
functions are so much nicer and safer than macros that you should only use
macros when there is a really good reason.



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.