summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2007-01-08 00:06:44 +0000
committerDave Mitchell <davem@fdisolutions.com>2007-01-08 00:06:44 +0000
commitea71c68d4e9e9831b358b56d13355d1b70bedf90 (patch)
tree673f05862db82c985d48f9c68c249be3ab6c7889
parentf8ec8cd2d5faa1409a6cf1952040da067208b229 (diff)
downloadperl-ea71c68d4e9e9831b358b56d13355d1b70bedf90.tar.gz
allocate op_pv strings from shared mem pool
p4raw-id: //depot/perl@29711
-rw-r--r--op.c9
-rw-r--r--toke.c2
2 files changed, 6 insertions, 5 deletions
diff --git a/op.c b/op.c
index 722867ac25..a21eb5db00 100644
--- a/op.c
+++ b/op.c
@@ -442,7 +442,7 @@ Perl_op_clear(pTHX_ OP *o)
cSVOPo->op_sv = NULL;
}
else {
- Safefree(cPVOPo->op_pv);
+ PerlMemShared_free(cPVOPo->op_pv);
cPVOPo->op_pv = NULL;
}
break;
@@ -3026,7 +3026,7 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
else
bits = 8;
- Safefree(cPVOPo->op_pv);
+ PerlMemShared_free(cPVOPo->op_pv);
cPVOPo->op_pv = NULL;
cSVOPo->op_sv = (SV*)swash_init("utf8", "", listsv, bits, none);
SvREFCNT_dec(listsv);
@@ -3083,7 +3083,8 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
else if (j >= (I32)rlen)
j = rlen - 1;
else
- cPVOPo->op_pv = (char*)Renew(tbl, 0x101+rlen-j, short);
+ cPVOPo->op_pv = (char*)PerlMemShared_realloc(tbl,
+ (0x101+rlen-j) * sizeof(short));
tbl[0x100] = (short)(rlen - j);
for (i=0; i < (I32)rlen - j; i++)
tbl[0x101+i] = r[j+i];
@@ -4622,7 +4623,7 @@ Perl_newLOOPEX(pTHX_ I32 type, OP *label)
if (label->op_type == OP_STUB && (label->op_flags & OPf_PARENS))
o = newOP(type, OPf_SPECIAL);
else {
- o = newPVOP(type, 0, savepv(label->op_type == OP_CONST
+ o = newPVOP(type, 0, savesharedpv(label->op_type == OP_CONST
? SvPVx_nolen_const(((SVOP*)label)->op_sv)
: ""));
}
diff --git a/toke.c b/toke.c
index 049474db89..87c26befcf 100644
--- a/toke.c
+++ b/toke.c
@@ -11008,7 +11008,7 @@ S_scan_trans(pTHX_ char *start)
}
no_more:
- Newx(tbl, complement&&!del?258:256, short);
+ tbl = PerlMemShared_calloc(complement&&!del?258:256, sizeof(short));
o = newPVOP(OP_TRANS, 0, (char*)tbl);
o->op_private &= ~OPpTRANS_ALL;
o->op_private |= del|squash|complement|