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=114372Thread Next