diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-08-16 10:50:14 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-08-18 11:26:37 -0600 |
commit | eb578fdb5569b91c28466a4d1939e381ff6ceaf4 (patch) | |
tree | cb76dfdd15ead716ff76b6a46eb1c49f10b302f2 /os2 | |
parent | 29205e9cdf0a179ed7a2e9401a3b19c8ede062db (diff) | |
download | perl-eb578fdb5569b91c28466a4d1939e381ff6ceaf4.tar.gz |
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.
Diffstat (limited to 'os2')
-rw-r--r-- | os2/OS2/OS2-REXX/REXX.pm | 2 | ||||
-rw-r--r-- | os2/OS2/OS2-REXX/REXX.xs | 2 | ||||
-rw-r--r-- | os2/os2.c | 14 |
3 files changed, 9 insertions, 9 deletions
diff --git a/os2/OS2/OS2-REXX/REXX.pm b/os2/OS2/OS2-REXX/REXX.pm index ca9fee69ce..a094232029 100644 --- a/os2/OS2/OS2-REXX/REXX.pm +++ b/os2/OS2/OS2-REXX/REXX.pm @@ -11,7 +11,7 @@ require OS2::DLL; # Other items we are prepared to export if requested @EXPORT_OK = qw(drop register); -$VERSION = '1.04'; +$VERSION = '1.05'; # We cannot just put OS2::DLL in @ISA, since some scripts would use # function interface, not method interface... diff --git a/os2/OS2/OS2-REXX/REXX.xs b/os2/OS2/OS2-REXX/REXX.xs index 6f4bf2b416..fdbed09767 100644 --- a/os2/OS2/OS2-REXX/REXX.xs +++ b/os2/OS2/OS2-REXX/REXX.xs @@ -61,7 +61,7 @@ static ULONG (*pRexxVariablePool) (PSHVBLOCK pRequest); static SV* exec_cv; /* Create a REXX compartment, - register `n' callbacks `handlers' with the REXX names `handlerNames', + `n' callbacks `handlers' with the REXX names `handlerNames', evaluate the REXX expression `cmd'. */ static SV* @@ -1345,8 +1345,8 @@ do_spawn_ve(pTHX_ SV *really, U32 flag, U32 execf, char *inicmd, U32 addflag) int do_spawn3(pTHX_ char *cmd, int execf, int flag) { - register char **a; - register char *s; + char **a; + char *s; char *shell, *copt, *news = NULL; int rc, seenspace = 0, mergestderr = 0; @@ -1477,9 +1477,9 @@ do_spawn3(pTHX_ char *cmd, int execf, int flag) int os2_aspawn_4(pTHX_ SV *really, register SV **args, I32 cnt, int execing) { - register SV **argp = (SV **)args; - register SV **last = argp + cnt; - register char **a; + SV **argp = (SV **)args; + SV **last = argp + cnt; + char **a; int rc; int flag = P_WAIT, flag_set = 0; STRLEN n_a; @@ -1560,8 +1560,8 @@ my_syspopen4(pTHX_ char *cmd, char *mode, I32 cnt, SV** args) { #ifndef USE_POPEN int p[2]; - register I32 this, that, newfd; - register I32 pid; + I32 this, that, newfd; + I32 pid; SV *sv; int fh_fl = 0; /* Pacify the warning */ |