New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perlcall documentation has no good example with POPs #13314
Comments
From @ruzCreated by @ruzperldoc perlcall lacks good example with POPs. Since poped SV is on I had to grep cpan to understand what to do to avoid freeing. Still Perl Info
|
From @jkeenanOn Thu Sep 26 03:49:32 2013, ruslan.zakirov@gmail.com wrote:
Do you feel you learned enough from that grepping to write a first draft I'm sure that others knowledgeable in that area could help get a draft Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @LeontOn Thu Sep 26 03:49:32 2013, ruslan.zakirov@gmail.com wrote:
It's FREETMPS that is relevant in this case, as mortal values are fried
POPs should never be used in a macro that can evaluate it multiple That said, it begs the question "why are you doing that in the first Leon Leon |
From ruz@bestpractical.comOn Fri, Sep 27, 2013 at 2:34 PM, Leon Timmermans via RT <
I knew that mortal are freed on FREETMPS, I just didn't know how to
Now I understand what "but can only be used with expressions without side That said, it begs the question "why are you doing that in the first
I've read the section that "explains" it and the section is heavy reading. Item 5 in "Passing Parameters" gives good explanation on why FREETMPS is 1) see the section "Using returned values after call" 2) See the section Using Perl to Dispose of Temporaries for details of an All examples in sections starting with "Returning ..." map returned values I hope above helps to understand my motives behind this request for Creating a quest to send doc patches, not sure when I get there.
-- |
From @ikegamiOn Fri, Sep 27, 2013 at 1:58 PM, Ruslan Zakirov <ruz@bestpractical.com>wrote:
In CS, a function has a side effect if it changes anything external. e.g. "Side effect" does not mean "adverse consequence", not even in medicine. |
From @ruzOn Fri, Sep 27, 2013 at 10:55 PM, Eric Brine via RT <
How do you know lc has no side effects? (rhetorical question) I sit there Does above change make description less exact? Why did you brought up wiki and CS? Do you think putting more words would hurt documentation by increasing its The following is waste of docs estate: SvREFCNT_inc All of the following SvREFCNT_inc* macros are optimized versions SV* SvREFCNT_inc(SV* sv) SvREFCNT_inc_NN SV* SvREFCNT_inc_NN(SV* sv) SvREFCNT_inc_simple SV* SvREFCNT_inc_simple(SV* sv) SvREFCNT_inc_simple_NN SV* SvREFCNT_inc_simple_NN(SV* sv) SvREFCNT_inc_simple_void void SvREFCNT_inc_simple_void(SV* sv) SvREFCNT_inc_simple_void_NN It can be something like the following: SvREFCNT_inc All of the following SvREFCNT_inc_* macros are optimized SV* SvREFCNT_inc(SV* sv) SvREFCNT_inc_* SV* SvREFCNT_inc_NN(SV* sv) Variants with "NN" in the name can only be used if you know sv It's shorter. Note that first part is incomplete, it goes on and on for PS. Just looked into sv.h and saw the following: 321 #define SvREFCNT_inc(sv) ··· ···S_SvREFCNT_inc(MUTABLE_SV(sv)) So since 5.17.4 SvREFCNT_inc_simple is not optimized anymore and actually -# define SvREFCNT_inc_simple(sv) \ On Fri, Sep 27, 2013 at 1:58 PM, Ruslan Zakirov <ruz@bestpractical.com>wrote:
-- |
From mail@steffen-mueller.netBy the way, check out "TOPs", the obvious equivalent to POPs without the On 09/27/2013 10:41 PM, Ruslan Zakirov wrote:
If it's API, then because it might be being used? Of course, then you --Steffen |
From @ikegamiOn Fri, Sep 27, 2013 at 4:41 PM, Ruslan Zakirov <ruslan.zakirov@gmail.com>wrote:
I told you what the word means because you suggested a correction that made Do you think putting more words would hurt documentation by increasing its
That wasn't the problem, no. |
From @bulk88On Fri Sep 27 03:34:02 2013, LeonT wrote:
AFAIK, to get an SV returned from a call_* to live past the FREETMPS, a SvREFCNT_inc is the solution. But, I thought of another situation, what if a DESTROY in a blessed SV being freeded in FREETMPS die()s? The SV* that got a ++ to live past the FREETMPS leaked. The newSVsv solution also leaked. -- |
From @iabynOn Mon, Dec 30, 2013 at 11:30:06AM -0800, bulk88 via RT wrote:
I don't understand what point you're trying to make. -- |
From @cpansproutOn Mon Dec 30 11:30:06 2013, bulk88 wrote:
That’s not a problem, because errors from DESTROY are always caught. -- Father Chrysostomos |
Migrated from rt.perl.org#120017 (status was 'open')
Searchable as RT120017$
The text was updated successfully, but these errors were encountered: