This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Omnibus removal of register declarations
authorKarl Williamson <public@khwilliamson.com>
Thu, 16 Aug 2012 16:50:14 +0000 (10:50 -0600)
committerKarl Williamson <public@khwilliamson.com>
Sat, 18 Aug 2012 17:26:37 +0000 (11:26 -0600)
commiteb578fdb5569b91c28466a4d1939e381ff6ceaf4
treecb76dfdd15ead716ff76b6a46eb1c49f10b302f2
parent29205e9cdf0a179ed7a2e9401a3b19c8ede062db
Omnibus removal of register declarations

This removes most register declarations in C code (and accompanying
documentation) in the Perl core.  Retained are those in the ext
directory, Configure, and those that are associated with assembly
language.

See:
http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c

which says, in part:

There is no good example of register usage when using modern compilers
(read: last 10+ years) because it almost never does any good and can do
some bad. When you use register, you are telling the compiler "I know
how to optimize my code better than you do" which is almost never the
case. One of three things can happen when you use register:

    The compiler ignores it, this is most likely. In this case the only
        harm is that you cannot take the address of the variable in the
        code.
    The compiler honors your request and as a result the code runs slower.
    The compiler honors your request and the code runs faster, this is the least likely scenario.

Even if one compiler produces better code when you use register, there
is no reason to believe another will do the same. If you have some
critical code that the compiler is not optimizing well enough your best
bet is probably to use assembler for that part anyway but of course do
the appropriate profiling to verify the generated code is really a
problem first.
47 files changed:
NetWare/NWUtil.c
XSUB.h
av.c
deb.c
dist/Data-Dumper/Dumper.xs
doio.c
doop.c
gv.c
hv.c
hv.h
malloc.c
mathoms.c
mg.c
mpeix/mpeix.c
mro.c
op.c
os2/OS2/OS2-REXX/REXX.pm
os2/OS2/OS2-REXX/REXX.xs
os2/os2.c
pad.c
perl.c
perly.c
pod/perlhacktut.pod
pp.c
pp_ctl.c
pp_hot.c
pp_pack.c
pp_sort.c
pp_sys.c
regcomp.c
regexec.c
run.c
scope.c
sv.c
toke.c
utf8.c
util.c
vms/vms.c
win32/fcrypt.c
win32/win32.c
win32/wince.c
x2p/a2p.c
x2p/a2py.c
x2p/hash.c
x2p/str.c
x2p/util.c
x2p/walk.c