From: Nicholas Clark Date: Fri, 10 May 2013 12:06:56 +0000 (+0200) Subject: As of v5.17.1, cop_stashpv no longer exists on threaded perls. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=274237771490ff6ee848d50ab6bdf4d7563738d9;p=p5sagit%2FDevel-Size.git As of v5.17.1, cop_stashpv no longer exists on threaded perls. Instead, the cop's stash is indirected via cop_stashoff and PL_stashpad. (See blead commit d4d03940c58a0177) --- diff --git a/CHANGES b/CHANGES index f345eec..62e318b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Revision history for Perl extension Devel::Size. +0.78_51 2013-05-10 nicholas + * v5.17.1 and later handle CopSTASH differently under ithreads + 0.78_50 2013-05-10 nicholas * Alternative test for CvOUTSIDE, and one for CvPADLIST * v5.17 changes the type of PADLIST [CPAN #83904] diff --git a/Size.xs b/Size.xs index 6f7d0fb..3b214ab 100644 --- a/Size.xs +++ b/Size.xs @@ -518,8 +518,16 @@ op_size(pTHX_ const OP * const baseop, struct state *st) #endif #ifdef USE_ITHREADS check_new_and_strlen(st, basecop->cop_file); +#ifdef PERL_VERSION < 17 || (PERL_VERSION == 17 && PERL_SUBVERSION == 0) + /* This pointer is owned by the COP, and freed with it. */ check_new_and_strlen(st, basecop->cop_stashpv); #else + /* A per-interpreter pointer for this stash is allocated in + PL_stashpad. */ + if (check_new(st, PL_stashpad + basecop->cop_stashoff)) + st->total_size += sizeof(PL_stashpad[basecop->cop_stashoff]); +#endif +#else sv_size(aTHX_ st, (SV *)basecop->cop_filegv, SOME_RECURSION); #endif