develooper Front page | perl.perl5.porters | Postings from October 2012

[perl #115452] [PATCH] 493e42b Re-enable static op allocation with obslab

Thread Previous
rurban @ cpanel . net
October 24, 2012 08:16
[perl #115452] [PATCH] 493e42b Re-enable static op allocation with obslab
Message ID:
# New Ticket Created by 
# Please include the string:  [perl #115452]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
generated with the help of perlbug 1.39 running under perl 5.17.5.

>From 493e42b1e78d670cee655d2f1e4b28b7e9ac86c8 Mon Sep 17 00:00:00 2001
From: Reini Urban <>
Date: Sun, 21 Oct 2012 18:56:11 -0500
Subject: [PATCH] Re-enable static op allocation with obslab

obslab and the removal of the op_latefree logic, which allowed static
ops, removed support for the compiler modules, which allocates ops statically.
Add an op_static flag to replace the old latefree(d) op_free logic.
 op.c |    3 ++-
 op.h |    7 +++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/op.c b/op.c
index 8fccf71..df5c050 100644
--- a/op.c
+++ b/op.c
@@ -303,7 +303,8 @@ Perl_Slab_Free(pTHX_ void *op)
     if (!o->op_slabbed) {
-	PerlMemShared_free(op);
+        if (!o->op_static)
+	    PerlMemShared_free(op);
diff --git a/op.h b/op.h
index 399c02e..9182b4d 100644
--- a/op.h
+++ b/op.h
@@ -20,8 +20,10 @@
  *	op_opt		Whether or not the op has been optimised by the
  *			peephole optimiser.
  *	op_slabbed	allocated via opslab
+ *	op_static	tell op_free() to skip PerlMemShared_free(), when
+ *                      !op_slabbed.
  *	op_savefree	on savestack via SAVEFREEOP
- *	op_spare	Four spare bits!
+ *	op_spare	Three spare bits
  *	op_flags	Flags common to all operations.  See OPf_* below.
  *	op_private	Flags peculiar to a particular operation (BUT,
  *			by default, set to the number of children until
@@ -53,7 +55,8 @@ typedef PERL_BITFIELD16 Optype;
     PERL_BITFIELD16 op_opt:1;		\
     PERL_BITFIELD16 op_slabbed:1;	\
     PERL_BITFIELD16 op_savefree:1;	\
-    PERL_BITFIELD16 op_spare:4;		\
+    PERL_BITFIELD16 op_static:1;	\
+    PERL_BITFIELD16 op_spare:3;		\
     U8		op_flags;		\
     U8		op_private;

Site configuration information for perl 5.17.5:

Configured by rurban at Sun Oct 21 18:48:43 CDT 2012.

Summary of my perl5 (revision 5 version 17 subversion 5) configuration:
  Commit id: 493e42b1e78d670cee655d2f1e4b28b7e9ac86c8
    osname=darwin, osvers=12.2.0, archname=darwin-debug@d86c4b18
    uname='darwin air2 12.2.0 darwin kernel version 12.2.0: sat aug 25 00:48:52 pdt 2012; root:xnu-2050.18.24~1release_x86_64 x86_64 i386 macbookair5,2 darwin '
    config_args='-de -Dusedevel -Dinstallman1dir=none -Dinstallman3dir=none -Dinstallsiteman1dir=none -Dinstallsiteman3dir=none -Dmksymlinks -DEBUGGING -Doptimize=-g3 -Uuseithreads -Dcc='gcc-mp-4.6' -Dld='gcc-mp-4.6' -Accflags='-m64' -Accflags='-mssse3' -Duseshrplib -Aldflags=-flat_namespace'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='gcc-mp-4.6', ccflags ='-fno-common -DPERL_DARWIN -m64 -mssse3 -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include',
    cppflags='-fno-common -DPERL_DARWIN -m64 -mssse3 -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include'
    ccversion='', gccversion='4.6.3', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc-mp-4.6', ldflags =' -flat_namespace -fstack-protector -L/usr/local/lib -L/opt/local/lib'
    libpth=/usr/local/lib /opt/local/lib /usr/lib
    libs=-lgdbm -ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector'

Locally applied patches:

@INC for perl 5.17.5:

Environment for perl 5.17.5:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About