develooper Front page | perl.perl5.porters | Postings from September 2023

Re: Calling Perl subs from XS under PERL_RC_STACK

Thread Previous
From:
Dave Mitchell
Date:
September 13, 2023 13:33
Subject:
Re: Calling Perl subs from XS under PERL_RC_STACK
Message ID:
ZQG6OQ1GCHns61kg@iabyn.com
On Wed, Sep 13, 2023 at 11:25:12PM +1000, sisyphus wrote:
> Another gun jumper here. Feel free to totally ignore this post.
> I'll just mention something that I've noticed with -DPERL_RC_STACK on
> Windows.
> I have (eg) an XSub in Math::GMPz called get_refcnt() which simply wraps
> SvREFCNT().
> I'm accustomed to seeing:
> 
> D:\>perl -MMath::GMPz -le "$z = 123; print Math::GMPz::get_refcnt($z);"
> 1
> 
> But with today's blead (commit 4e1743c0), I've built perl with
> -DPERL_RC_STACK for the first time, and I'm getting:
> 
> D:\>perl -MMath::GMPz -le "$z = 123; print Math::GMPz::get_refcnt($z);"
> 2
> 
> I assume that this is under control and will be taken care of in due course.
> But do let me know if this warrants further investigation, or if you want
> additional information.

In general on PERL_RC_STACK builds, 'live' SVs (i.e. those currently on
the stack) will have a refcount 1 higher than they would on
non-PERL_RC_STACK builds.

-- 
Nothing ventured, nothing lost.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About