From: Florian Ragwitz Date: Sun, 30 Sep 2012 07:50:52 +0000 (+0900) Subject: Move SvSTASH counting from SVt_PVCV to >= SVt_PVMG X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7c8a009af172963b0e7bcf246281edc34ab65aa2;p=p5sagit%2FDevel-Size.git Move SvSTASH counting from SVt_PVCV to >= SVt_PVMG I assume that certain stashes might not be reached using the previous behaviour. Both objects and CVs (and possibly even others) can have a stash. For anonymous stashes without CVs in them, I believe SvSTASH would not be counted if an object blessed in said anonymous stash would be processed. --- diff --git a/Memory.xs b/Memory.xs index dcb0584..899de95 100644 --- a/Memory.xs +++ b/Memory.xs @@ -1172,7 +1172,6 @@ else warn("skipped suspect HeVAL %p", HeVAL(cur_entry)); case SVt_PVCV: TAG; /* not CvSTASH, per https://rt.cpan.org/Ticket/Display.html?id=79366 */ ADD_ATTR(st, NPattr_NAME, CvGV(thing) ? GvNAME(CvGV(thing)) : "UNDEFINED", 0); - sv_size(aTHX_ st, NPathLink("SvSTASH"), (SV *)SvSTASH(thing), SOME_RECURSION); sv_size(aTHX_ st, NPathLink("CvGV"), (SV *)CvGV(thing), SOME_RECURSION); padlist_size(aTHX_ st, NPathLink("CvPADLIST"), CvPADLIST(thing), recurse); sv_size(aTHX_ st, NPathLink("CvOUTSIDE"), (SV *)CvOUTSIDE(thing), SOME_RECURSION); @@ -1273,6 +1272,8 @@ else warn("skipped suspect HeVAL %p", HeVAL(cur_entry)); magic_size(aTHX_ thing, st, NPathLink("MG")); if (SvPAD_OUR(thing) && SvOURSTASH(thing)) sv_size(aTHX_ st, NPathLink("SvOURSTASH"), (SV *)SvOURSTASH(thing), SOME_RECURSION); + if (SvSTASH(thing)) + sv_size(aTHX_ st, NPathLink("SvSTASH"), (SV *)SvSTASH(thing), SOME_RECURSION); } return;