[Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7195 >
Ross Wetmore wrote:
> 1) Use local variables. Assiging globals to local variables at the start
> of a code block and then using only the local variables within the
> block lets the compiler know they are not subject to change except if
> done explicitly in the code block.
Using local variables _is_ the greatest thing in the world. (Except for
a nice MLT - mutton, lettuce, and tomato sandwich. When the mutton is
nice and lean and the tomato is ripe, they're so perky. I love that.)
But we can't use local variables in a function-like macro that returns a
value. So our only alternatives are
(1) Do extra calculation rather than store the temporary values. This
is what the macro form in CVS did, and it's definitely slower.
(2) Use global variables. This is what your corecleanups patch does.
But then the caller has to worry about sequence points and lots of them
have to be rewritten. No good.
jason
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, (continued)
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, Raimar Falke, 2004/01/06
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, Jason Short, 2004/01/06
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, ue80@xxxxxxxxxxxxxxxxxxxxx, 2004/01/06
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, Per I. Mathisen, 2004/01/06
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, Raimar Falke, 2004/01/06
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, Raimar Falke, 2004/01/08
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, rwetmore@xxxxxxxxxxxx, 2004/01/09
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, rwetmore@xxxxxxxxxxxx, 2004/01/09
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, Jason Short, 2004/01/09
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, rwetmore@xxxxxxxxxxxx, 2004/01/14
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index,
Jason Short <=
- [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index, rwetmore@xxxxxxxxxxxx, 2004/01/18
|
|