Memory leak with PUSHMARK and PUTBACK

U

Uwe Gansert

Hi,

I'm fighting with using Perl Modules from within C programms.
While digging into that topic, I'm wondering why the following simple C
function is a memory leak:


void leak() {
dSP;
PUSHMARK(SP);
PUTBACK;
}

calling this function in an endless loop, eats up all free memory.
perl -v => "This is perl, v5.8.5 built for i586-linux-thread-multi"
 
T

Ton Hospel

Hi,

I'm fighting with using Perl Modules from within C programms.
While digging into that topic, I'm wondering why the following simple C
function is a memory leak:


void leak() {
dSP;
PUSHMARK(SP);
PUTBACK;
}

calling this function in an endless loop, eats up all free memory.
perl -v => "This is perl, v5.8.5 built for i586-linux-thread-multi"

Nothing ever consumes the marks, so you keep the markstack growing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,166
Messages
2,570,901
Members
47,442
Latest member
KevinLocki

Latest Threads

Top