Re: [RFC PATCH] explicitly mark recursion count

Linus Torvalds
2004-06-02T16:26:22Z

On Wed, 2 Jun 2004, Jörn Engel wrote:
>
> Works for me for trivial recursions (just one function involved. With
> a little more pain, it should work for basically everything. Only
> exception are multiple recursions around the same function. So unless
> you like to keep those suckers, I'm fine with it.

Well, multiple recursion around the same function seems to be solvable two
different ways:
- "don't do that then". It really seems broken, but maybe there are
really really good reasons _why_ it's not broken and why it happens.
- make sure that the separate loops are broken in some _other_ place than
in the function they share.

A combination of the two may work well.

I say "may", because maybe I'm wrong, and the condition is common and hard
to avoid limiting in the shared function. I don't have your data (and I'm
lazy, so quite frankly I'd much rather you do the analysis anyway ;).

That said, I just don't see any sane alternatives to my "break in one
place" thing. I believe that anything more complex that tries to explain
the whole loop is just going to be a nightmare to maintain, and fragile as
hell except for totally static legacy code that nobody touches any more.

Linus