Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] Re: (PR#7279) Macro optimizations
Home

[Freeciv-Dev] Re: (PR#7279) Macro optimizations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: a-l@xxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7279) Macro optimizations
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Tue, 27 Jan 2004 02:51:45 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7279 >

On Mon, Jan 26, 2004 at 07:49:11PM -0800, Jason Short wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7279 >
> 
> > [rwetmore@xxxxxxxxxxxx - Tue Jan 27 02:43:58 2004]:
> 
> > If the maintainers have done their homework, understood ths issues,
> > presented all the arguments and with the concensus of the community
> > reached a decision to change core Freeciv standards or start a new
> > version written in C++, then that is fine.
> 
> Do you think we'll get any consensus?
> 
> Here are the code requirements I'd impose:
> 
> 1. Each macro must evaluate each of its arguments exactly once.
> 2. No function-like macro should impose additional restrictions that a
>    function would not.  Specifically this refers to the sequence point
>    problem.
> 3. Any macro that pretends to be a loop must respect "break".
> 4. Inlining should only be used when it gives a substantial improvement
> (in speed or code size) over macro or traditional function forms.
> 
> These are all technical specifications.  The point is that any macro
> that looks like a function or loop must _behave_ like a function or
> loop, so that the normal rules of C apply.
> 
> #1 and #3 would require some fixes to existing macros.  #1 may also
> preclude some current macros from being written in function form.  #2
> and #4 are not currently a problem anywhere AFAIK.
> 
> Discuss.

I want #4 reverted to read.

4. Macros should only be used when it gives a substantial improvement
(in speed or code size) over inlining or traditional function forms.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Understanding is a three-edged sword; 
  your side, their side, and the truth."
    -- a well-known Vorlon




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