llancet has asked for the wisdom of the Perl Monks concerning the following question:
For instance, in this piece of code:
Does XPUSHs make a copy of my_sv, or it really pushes my_sv into stack?SV* my_sv = newSViv(12345); XPUSHs(my_sv);
And in this piece of code:
It seems if I want to use the poped SV permanently (after FREETMPS and LEAVE), I have to make a copy of return by newSVsv(), otherwise return will lose the value inside it?SPAGAIN; ENTER; SAVETMPS; PUSHMARK(SP); call_pv( "a_perl_sub_that_return_something", some_flags ); SV* return = POPs; FREETMPS; LEAVE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What does perl stack OPs really do?
by ikegami (Patriarch) on Jun 20, 2011 at 18:36 UTC | |
by llancet (Friar) on Jun 21, 2011 at 04:34 UTC | |
by Anonymous Monk on Jun 23, 2011 at 09:48 UTC | |
by llancet (Friar) on Jun 25, 2011 at 02:20 UTC | |
by llancet (Friar) on Jun 25, 2011 at 01:52 UTC | |
|
Re: What does perl stack OPs really do?
by Anonymous Monk on Jun 20, 2011 at 09:52 UTC |