[EMAIL PROTECTED] wrote:
Hi!
I hope this is the right list for this question. If not, please direct to
appropriate one.
My problem is simple. I'm embedding perl into my C program (perl 5.6.1).
I noticed that when I use eval_pl in my code then my program leaks memory. So
finally I reduced my program to do the following.
for(i = 0; i < 1000; i++)
{
SV * sub;
char text[256];
sprintf(text, "$sub = %d;", i);
sub = eval_pv(text, TRUE);
sleep(1);
}
I'm loosing approximatly 1K on each iteration. What is the problem here? I
tried to SvREFCNT_dec(sub), but this leads to "Attempting to free unreferenced
scalar." warning from perl and does not stop the leak. Is there any way to
avoid it?
Andrei
PS. I'm not subscribed to the list. Please include my address in the CC field
when replying
I think you can do
sprintf(text,"{my $sub= %d; } " , i)
Not sure it will work , just a guess
Ram
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]