Skip to content

Commit 08b6158

Browse files
committed
Perl_newSVpvz - add some ASSUMEs to help the compiler
1 parent eb246bb commit 08b6158

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6305,6 +6305,11 @@ Perl_newSVpvz(pTHX_ const STRLEN len)
63056305
{
63066306
SV *sv = newSV_type(SVt_PV);
63076307
sv_grow_fresh(sv, len + 1);
6308+
6309+
/* Some ASSUMEs which may help the compiler avoid unnecessary work */
6310+
ASSUME(SvCUR(sv) == 0);
6311+
ASSUME(SvFLAGS(sv) == SVt_PV);
6312+
ASSUME(!TAINT_get);
63086313
(void) sv_setpv_freshbuf(sv);
63096314

63106315
return sv;

0 commit comments

Comments
 (0)