summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorSpider Boardman <spider@Orb.Nashua.NH.US>1996-09-30 01:13:28 -0400
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-09-30 01:13:28 -0400
commit69969c6f8dad38fedd2ed2c653a7948030e5ecf8 (patch)
tree3e3df0c33359d4eece399cf3645595ae8f591f1b /op.c
parent946ec16ea935ac14ffffc87fcb9676a65aabcaa5 (diff)
downloadperl-69969c6f8dad38fedd2ed2c653a7948030e5ecf8.tar.gz
Re: pre extending hash? - need speed
Restore the 5.003 gv_fullname() and gv_efullname() functions. Provide new 3-arg forms gv_fullname3() and gv_efullname3(). The patch below (which is relative to perl5.001l) implements "keys %hash = 50_000;" (or other integer-evaluable sizes) for pre-sizing hashes. I've only moved the patch forward from when I first did it. I'm sure the code in hv_ksplit could be improved.
Diffstat (limited to 'op.c')
-rw-r--r--op.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/op.c b/op.c
index b992fdef6f..d3b03440c7 100644
--- a/op.c
+++ b/op.c
@@ -49,7 +49,7 @@ CvNAME(cv)
CV* cv;
{
SV* tmpsv = sv_newmortal();
- gv_efullname(tmpsv, CvGV(cv), Nullch);
+ gv_efullname3(tmpsv, CvGV(cv), Nullch);
return SvPV(tmpsv,na);
}
@@ -1010,6 +1010,11 @@ I32 type;
case OP_PUSHMARK:
break;
+ case OP_KEYS:
+ if (type != OP_SASSIGN)
+ goto nomod;
+ mtype = 'k';
+ goto makelv;
case OP_POS:
mtype = '.';
goto makelv;
@@ -2977,7 +2982,7 @@ OP *block;
sv_catpv(sv,"-");
sprintf(buf,"%ld",(long)curcop->cop_line);
sv_catpv(sv,buf);
- gv_efullname(tmpstr, gv, Nullch);
+ gv_efullname3(tmpstr, gv, Nullch);
hv_store(GvHV(DBsub), SvPVX(tmpstr), SvCUR(tmpstr), sv, 0);
}
op_free(op);