in reply to Re^6: Memory leak!
in thread Memory leak!
You've showed that Deparse considers for (;;) {} and while (1) {} equivalent (which means there's a strong chance that they are very similar). This is consistent with while (1) {} getting optimised to for (;;) {}, so it doesn't support your contradiction.
You've showed that Deparse considers while (1) {} to be more readable than for (;;) {} on average. This doesn't support your contradiction.
So you didn't show that while (1) {} doesn't get optimised to for (;;) {}. Easy to prove that it does, though. Note the lack of any condition in the following:
>perl -MO=Concise,-exec -e"while (1) {}" 1 <0> enter 2 <;> nextstate(main 3 -e:1) v:{ 3 <{> enterloop(next->5 last->6 redo->4) v 4 <0> stub v 5 <0> unstack v -e syntax OK
For comparison,
>perl -MO=Concise,-exec -e"for (;;) {}" 1 <0> enter 2 <;> nextstate(main 3 -e:1) v:{ 3 <{> enterloop(next->5 last->6 redo->4) v 4 <0> stub v 5 <0> unstack v -e syntax OK
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Memory leak! (yawn)
by tye (Sage) on Dec 13, 2011 at 05:24 UTC | |
by ikegami (Patriarch) on Dec 13, 2011 at 06:42 UTC | |
|
Re^8: Memory leak!
by BrowserUk (Patriarch) on Dec 13, 2011 at 05:35 UTC | |
by ikegami (Patriarch) on Dec 13, 2011 at 06:49 UTC | |
by BrowserUk (Patriarch) on Dec 13, 2011 at 07:14 UTC | |
by ikegami (Patriarch) on Dec 13, 2011 at 07:31 UTC | |
by BrowserUk (Patriarch) on Dec 13, 2011 at 07:42 UTC | |
|