On Tue, Dec 27, 2016 at 12:24 PM, Dave Mitchell <davem@iabyn.com> wrote: > Dealing with XS in the short term is fairly trivial. Have a flag on each > XS CV indicating that it knows about a reference-counted stack. In > pp_entersub(), when calling an XS sub that hasn't got that flag (which > initially is all of them), Copy() the sub's args, so that there are two > copies of all the sub's args on the stack - a reference-counted set which > the XS sub doesn't know about, and a second set which aren't > reference-counted, and the XS sub sees. On return, bump the reference > count of the returned args, decrement the reference count of the passed > args, then shuffle the returned args down the stack. It helps that the most common case (CODE instead of PPCODE, and fixed length argument list) can easily be handled in ExtUtils::ParseXS. LeonThread Previous