there is at least one scope that never releases its memory.
In your original program, yes. It never releases memory, but that memory is still needed. That doesn't meet the definition of a leak.
Keep in mind that the run-time effect of
is similar tomy $i;
Hook::Scope::POST(sub { $i = undef });
It pushes an instruction on the stack to clear the scope on exit (which could happen, say, if an exception occurs).
In reply to Re^3: "goto" memory leak
by ikegami
in thread "goto" memory leak
by jethro
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |