This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
treat TAINT_get and TAINTING_get as unlikely
authorTony Cook <tony@develop-help.com>
Thu, 12 Dec 2019 05:49:11 +0000 (16:49 +1100)
committerTony Cook <tony@develop-help.com>
Sun, 15 Dec 2019 23:30:45 +0000 (10:30 +1100)
commitea42b70b7ad91e682c326194267de09a43c3ef89
tree920779e0d69f131dccb0c2d90cc5fc8541ab8b81
parent0850138d5ff43e9778637c50e5dfc4c06ada52c6
treat TAINT_get and TAINTING_get as unlikely

While testing #17359 it appeared that inlining of SvTRUE was being
suppressed (indicated by -Winline) by being used in the statement:

  if (TAINT_get || SvTRUE(error)) {

but making TAINT_get unlikely allowed it to be inlined.

I expect even in a program that does use taint the vast majority
of data will be untainted, so I think it's safe to make TAINT_get
UNLIKELY().

TAINTING_get is a harder case, but it's only used in a relatively
much smaller number of cases, and I expect most runs of a system
perl will have neither -T nor -t.
perl.h
scope.c