in reply to Re^2: what definition of Istack_sp
in thread what definition of Istack_sp

The perl binary has multiple ways in which it can be built. The simplest (and original) model just defines PL_stack_sp directly as a global variable. But when built with MULTIPLICITY (when for example building a threaded perl), then multiple interpreters are allowed, and (within the core), PL_stack_sp is defined as my_perl->Ispack_sp.

However in XS code (rather than in the core), it's more complex. At one point PL_stack_sp was defined as a function call, which would shield the XS code from changes in the interpreter struct layout across differing perl versions - so XS modules wouldn't have be to recompiled for each new perl release. However, this slowed XS code down a lot, and there were other things which also broke binary compatibility, so that was ditched and we just changed the binary guarantee to apply only across minor releases.

Dave.

Replies are listed 'Best First'.
Re^4: what definition of Istack_sp
by xiaoyafeng (Deacon) on Jan 14, 2019 at 08:14 UTC
    Thanks for your detailed answer! By the way, as your replied on this , 5.30 will add named parameter. I'm curious if it would affect current mechanism of argument stack which you mentioned above?




    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

      Thanks for your detailed answer! By the way, as your replied on this , 5.30 will add named parameter. I'm curious if it would affect current mechanism of argument stack which you mentioned above?
      That's no longer likely to happen for 5.30: I ran out of time. Named sub parameters will only affect the sub itself, not the caller; and named args will only apply to perl subs, not to XS subs.

      Dave.