Subject: | generate_for() coderef memory leak |
Date: | Sun, 27 May 2012 09:42:48 +1000 |
To: | bug-Scalar-Util-Instance [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With recent debian i386 perl 5.14.2, running a program
use Scalar::Util::Instance;
for (;;) {
Scalar::Util::Instance->generate_for('Foo');
}
uses ever more memory, whereas I hoped the anonymous coderef returned
would garbage collect when no longer used.
I wonder if the rv return in generate_for() should have an sv_2mortal.
That newRV is not used other than in the return is it?
XPUSHs( sv_2mortal(newRV_noinc((SV*)xsub)) );
--
The sigfile English idioms series:
"When the cat's away the mice will play"
-- in the absence of authority there will be wrongdoing.