XSUBs provide an ANY union that code can store whatever it wants, to be later accessed within the CV body. Being an ANY union, one of the possibilities is to store an SV pointer in there. This is fairly common (at least, in my code). Since it stores an SV pointer, you need to arrange for it to be SvREFCNT_dec'ed when the CV itself is destroyed (e.g. perhaps the CV is an anonymous closure). Perl doesn't currently provide a facility for this, meaning I end up having to do annoying magic on the CV just to make it happen at the right time. I'm thinking of adding a CV flag to tell Perl to do that automatically. When clearing an SV it can then use if(FLAG) SvREFCNT_dec(CvXSUBANY(cv).any_sv); Thoughts anyone? -- Paul "LeoNerd" Evans leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/Thread Next