Wouldn't this leak if the if-statement was creating a stack frame as you said?#!/usr/bin/perl use strict; use warnings; bar(); sub bar { my $result = foo(); if ( $result ) { goto &bar; } return; } my $i = 0; sub foo { return $i++ < 1_000_000_000; }
In reply to Re^6: memory leak when using tail recursion?
by juddhuck
in thread memory leak when using tail recursion?
by juddhuck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |