[Freeciv-Dev] Re: list cleaning
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, Nov 29, 2003 at 03:07:19PM +0000, Per I. Mathisen wrote:
> On Sat, 29 Nov 2003, Raimar Falke wrote:
> > There is another way. If this 'normalize' iterators are in place we
> > can ensure with assert that unlink isn't called when we are currently
> > iterating over the list. Such cases would then be replaced (by hand)
> > with safe iterations. This is the conservative approach: you can be
> > sure that there are no unsafe unlinks and there is a known and
> > constant memory and cpu-time usage.
>
> Not if deletions only happen in extremely rare cases. This does happen.
Yes. However we will know that this happens.
> Then you just introduced a new bug where there may not have been one
> previously.
I don't understand.
There is another safety with this approach: if there is a still
'unnormalize' iterator the nesting count will remain >1. This will
cause the assertion to trigger even if the code was correctly
converted to use the safe version.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
Tank: So what do you need? Besides a miracle.
Neo: Guns. Lots of guns.
-- From The Matrix
- [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 <=
- [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
- [Freeciv-Dev] Re: list cleaning, Jason Dorje Short, 2003/11/30
|
|