[Freeciv-Dev] Re: list cleaning
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, 29 Nov 2003, Vasco Alexandre Da Silva Costa wrote:
> > > genlists. When genlist_prune() is called, it cleans every registered list.
> > > This way we can be certain that lists are only cleaned a limited number of
> > > times and only when it is guaranteed safe to do so.
> >
> > This is possible to achieve faster code. Another idea is to use a bool
> > flag in the genlist which is set to TRUE when a node is deleted and to
> > FALSE after prune got called. prune will only be called if this
> > deleted field is TRUE.
>
> The modified version of Per's code I have already does this, but I still
> need to fix the iterations. Now that delta is in CVS, I can resume work
> on that.
This is not a bad idea, however you still need to ensure that the lists
are always normalized (prohibit goto and return inside iterators).
It is also a few additional instructions on each iterator end...
With my approach, you don't need to change the iterators, avoid the demand
that all future iterators are 'normalized' and it is the fastest way.
- Per
- [Freeciv-Dev] list cleaning, Per I. Mathisen, 2003/11/29
- [Freeciv-Dev] Re: list cleaning, Raimar Falke, 2003/11/29
- [Freeciv-Dev] Re: list cleaning, Raimar Falke, 2003/11/29
- [Freeciv-Dev] Re: list cleaning, Per I. Mathisen, 2003/11/29
- [Freeciv-Dev] Re: list cleaning, Raimar Falke, 2003/11/29
- [Freeciv-Dev] Re: list cleaning, Per I. Mathisen, 2003/11/29
- [Freeciv-Dev] Re: list cleaning, Raimar Falke, 2003/11/30
- [Freeciv-Dev] Re: list cleaning, Per I. Mathisen, 2003/11/30
- [Freeciv-Dev] Re: list cleaning, Raimar Falke, 2003/11/30
- [Freeciv-Dev] Re: list cleaning, Vasco Alexandre Da Silva Costa, 2003/11/30
- [Freeciv-Dev] Re: list cleaning, Raimar Falke, 2003/11/30
- [Freeciv-Dev] Re: list cleaning, Vasco Alexandre Da Silva Costa, 2003/11/30
|
|