in reply to Re^5: memory leak when using tail recursion?
in thread memory leak when using tail recursion?
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: memory leak when using tail recursion?
by ikegami (Patriarch) on Feb 14, 2007 at 00:38 UTC | |
|
Re^7: memory leak when using tail recursion?
by ikegami (Patriarch) on Mar 15, 2007 at 01:05 UTC |