Yeah, I learned to do stuff like that ages ago in PL/I in order to save a
few bytes on small machines, since the compiler could reuse memory that
had "lost its name" when another variable is declared in another inner
scope. These days compilers often do a much better job of
variable-lifetime analysis so I should probably stop.
There's also the question of variable lifetime in the programmer's mind as
he works through the code, but I can't decide whether I find it more
confusing to see a huge block of declarations up front and no mention of
many of these symbols until 'way down the function, or to see new
variables being created and destroyed throughout the function. (You could
break up the function into several smaller ones, and in a style course
you'd probably do that, but you might not do it in the critical path
through a gigabit router due to call/return overhead.)
-- Mark H. Wood, Lead System Programmer mwood@IUPUI.Edu Some things are not improved when made "graphical". Imagine how crude Kilmer's "Trees" would be if reduced to comic-book form.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/