in reply to Re: XS: Manipulating refcounts
in thread XS: Manipulating refcounts
Thanks, demerphq. I've been using sv_dump, which is handy, though it is frustrating that it only shows one level. For instance, it would only show the reference, and not the object (caveat: I'm not sure I haven't got those mixed up -- see my reply to mugwumpjism):
SV = RV(0x182186c) at 0x1856bf8 REFCNT = 1 FLAGS = (PADBUSY,PADMY,ROK) RV = 0x1801380 SV = PVMG(0x1822080) at 0x1801380 /* instead of... */ SV = RV(0x182186c) at 0x1856bf8 REFCNT = 1 FLAGS = (PADBUSY,PADMY,ROK) RV = 0x1801380 SV = PVMG(0x1822080) at 0x1801380 REFCNT = 2 FLAGS = (OBJECT,IOK,pIOK) IV = 3880080 NV = 0 PV = 0 STASH = 0x180b56c "Artist"
To find out how to make multiple levels appear, I peeked inside ext/Devel/Peek/Peek.xs and saw that it was implemented using the private function do_sv_dump. Obviously, do_sv_dump doesn't belong in production code, but this is just debugging and it's even handier than sv_dump if you're motivated enough to memorize its 7-argument interface.
|
|---|