This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_Slab_Alloc(): tweak logging
authorDavid Mitchell <davem@iabyn.com>
Wed, 25 Sep 2019 17:34:09 +0000 (18:34 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 25 Sep 2019 20:51:29 +0000 (21:51 +0100)
When looking for a suitable op-sized chunk of memory in a slab's free
list, perl logs the search but doesn't log a successful match. Add such
a log line to make analysis of the output of 'perl -DS' easier.

op.c

diff --git a/op.c b/op.c
index e875a90..cc324fe 100644 (file)
--- a/op.c
+++ b/op.c
@@ -316,6 +316,10 @@ Perl_Slab_Alloc(pTHX_ size_t sz)
            if (o) { DEBUG_S_warn((aTHX_ "found another free op at %p", (void*)o)); }
        }
        if (o) {
+            DEBUG_S_warn((aTHX_ "realloced  op at %p, slab %p, head slab %p",
+                (void*)o,
+                (I32**)OpSLOT(o) - OpSLOT(o)->opslot_offset,
+                (void*)head_slab));
            *too = o->op_next;
            Zero(o, opsz, I32 *);
            o->op_slabbed = 1;