develooper Front page | perl.perl5.porters | Postings from August 2016

[perl #114372] Panic in pure-Perl code with vanilla perl-5.16.0 fromperlbrew

Thread Next
From:
Father Chrysostomos via RT
Date:
August 12, 2016 05:21
Subject:
[perl #114372] Panic in pure-Perl code with vanilla perl-5.16.0 fromperlbrew
Message ID:
rt-4.0.24-6774-1470979282-430.114372-15-0@perl.org
On Sat Jul 16 15:31:33 2016, zefram@fysh.org wrote:
> Father Chrysostomos via RT wrote:
> >How can we have POPs defined both ways in the same file?
> 
> Like this...
> 
> Core headers define macros to operate both ways based on a switch:
> 
>     #define POPs (PERL_STACK_LOCALLY_REFCOUNTED ? \
> 	sv_2mortal(*sp--) : (*sp--))
>     #define PUSHs(s) (PERL_STACK_LOCALLY_REFCOUNTED ? \
> 	(*++sp = SvREFCNT_inc(s)) : (*++sp = (s)))
>     #define TOPs (*sp) /* same either way */

How would you suggest we handle call_sv and similar functions?  Should we stop the macro wrapper from being generated by regen/embed.pl and define something like this manually:

  #define call_sv(a,b) \
     call_sv_rstack(a,b,PERL_STACK_LOCALLY_REFCOUNTED)

where the _rstack version takes a bool parameter?

But what do we do with calls that explicitly use a Perl_ prefix?  Should they just be assumed to be using the non-rc stack?  Should Perl_call_sv be deprecated in favour of the macro, so that any code using it will warn at compile time?

I can see several ways of doing this.  I would like the opinion of others.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=114372

Thread Next


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