In perl.git, the branch smoke-me/khw-memchr has been created
<http://perl5.git.perl.org/perl.git/commitdiff/fbad2556605648f34922680dcaefe2b991a30b54?hp=0000000000000000000000000000000000000000>
at fbad2556605648f34922680dcaefe2b991a30b54 (commit)
- Log -----------------------------------------------------------------
commit fbad2556605648f34922680dcaefe2b991a30b54
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 14:24:41 2017 -0600
Data::Dumper: Change strcpy to strlcpy
strlcpy is safer. This reverts to using strcpy if no version of strlcpy
is available (but one has been available in Perl since 5.9.4)
M dist/Data-Dumper/Dumper.xs
commit 725d63599004224fc61885fdd7bb0ef6e665d131
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 14:16:27 2017 -0600
DynaLoader: Use strlcpy instead of strcpy
strlcpy is safer.
M ext/DynaLoader/DynaLoader_pm.PL
M ext/DynaLoader/dl_win32.xs
commit 6e496da49e9e762e149e3e34da1e0a8359e82ee0
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 17:51:50 2017 -0600
toke.c: Outdent block
The surrounding block was removed by the previous commit
M toke.c
commit b07669bc3b82f8cdf5f5c88870309fca7ee6230d
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 13:43:31 2017 -0600
toke.c: Replace loop by memchr
See merge commit message for more information
M toke.c
commit e85279224c2ae03660d1501d4d9559129ebafc9f
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 13:42:49 2017 -0600
toke.c: Use memchr in loop; don't examine every byte
See merge commit message for more information
M toke.c
commit 1517ccc26f4f7d638a6a84419e2fda240a9b1b0a
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 13:41:39 2017 -0600
toke.c: Replace loop by memchr
See merge commit message for more information
M toke.c
commit cdde3496235e83d3ba4992297d0cbefff3f7681a
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 13:40:45 2017 -0600
toke.c: Replace loop by memchr
See merge commit message for more information
M toke.c
commit 374f33f65d9c6c7938165a1993df301019a7928f
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 13:39:40 2017 -0600
toke.c: Replace loop by memchr
See merge commit message for more information
M toke.c
commit 98c89de5b30ad09eec038599b2cc44c2c42c991a
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 13:39:07 2017 -0600
toke.c: Replace loop by memchr
See merge commit message for more information
M toke.c
commit c8a3253a0bbd9c4224715b948bc116dcfa256aa8
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 13:37:21 2017 -0600
toke.c: Use memchr in loop; don't examine every byte
See merge commit message for more information
M toke.c
commit 1af2317c10fcecb404f7e174ebf0365c23bd383d
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 13:34:03 2017 -0600
regcomp.c: Replace loop by memchr
See merge commit message for more information
M regcomp.c
commit b08ad4568a4b1ff71a26eaf093d67fd8543822ce
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 13:33:33 2017 -0600
regcomp.c: Replace loop by memchr
See merge commit message for more information.
M regcomp.c
commit b95cef59f7d399a8b4c97a21ee93512182d78e2b
Author: Karl Williamson <[email protected]>
Date: Mon Mar 27 13:29:57 2017 -0600
regcomp.c: Replace loop by memchr()
See merge commit message for more information.
M regcomp.c
commit 7666d0a7732f4981a775675d4b143a16beae0d18
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 17:07:26 2017 -0600
pp_ctl.c: White-space only
Outdent due to block removed by the previous commit
M pp_ctl.c
commit 97b69007b95a3542d4fff212109118d206d9b1f4
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 17:00:22 2017 -0600
XXX Use first part of this for merge commit msg pp_ctl.c: Replace loop by
using memchr
I did an audit of core for loops that exit when they have found a
particular character. All such loops have an upper limit that they are
not to look beyond, which may not be explicit. I changed these loops
to instead use memchr(). This is cleaner, and may be faster.
Some loops look for a particular character, but don't exit when they
find one; instead they do special processing, and keep going until the
end of the input is reached. In these cases, I retained the loop, but
changed to use memchr() to find the character of interest. Again, this
may be faster.
I made a separate commit in this branch for each changed loop. This is
so, should I have messed up, a bisect will immediately finger the exact
culprit.
See the merge commit message for more information.
M pp_ctl.c
commit dc90e955b591e0988671a34a6dc6c8f18982f4fb
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 15:06:58 2017 -0600
toke.c: Convert some strchr to memchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
M toke.c
commit d9cb7ca4b3bf8aebbfc126b56a61ce2a46f35af5
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 15:00:22 2017 -0600
regcomp.c: Convert some strchr to memchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
M regcomp.c
commit c3da1c9cc9b93470e4b914fc0082afe6a58a91c8
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 14:55:08 2017 -0600
perl.c: Use memchr instead of strchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
M perl.c
commit c5e8f94f35b82109c790ef744a4e396098f3833c
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 14:54:13 2017 -0600
op.c: Use memchr instead of strchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
M op.c
commit 88a9862f53514b151ffae9e7570352ac65f6978c
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 14:53:07 2017 -0600
mg.c: Use memchr instead of strchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
M mg.c
commit a1e3201fa47ea1d52bd58003dc7c183009453118
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 14:51:19 2017 -0600
doio.c: Change strchr to memchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
M doio.c
commit 427dc8f583ed72dac73d77e49defffcb6dce4ae0
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 14:50:48 2017 -0600
pp_sys.c; Use memchr instead of strchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
M pp_sys.c
commit d9de3e88876fb645a3f3f25308ce53695d7862b2
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 14:46:50 2017 -0600
utf8.c: Use memchr instead of strchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
M utf8.c
commit 52309207b7796aade0145b9ab88dae331e0397ad
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 12:04:30 2017 -0600
toke.c: Add limit param to 3 static functions
memchr and memrchr are now used instead of strchr and strrchr. This
allows them to work properly in the face of embedded NULs. A limit
parameter is added to each function. See the branch merge message for
more information.
M embed.fnc
M embed.h
M proto.h
M toke.c
commit 9f95b48458f9bb57bc372df3609cc42f929c9873
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 11:39:05 2017 -0600
XXX use this as merge message. dquote.c: Use memchr() instead of strchr()
Using C string functions on Perl strings doesn't work properly if they
contain embedded NULs. This can happen with Perl program text, for
example, and even if the NUL is illegal, the generated diagnostics are
likely to be misleading as the parsing would have terminated
prematurely.
I have done an audit on core for cases where C string functions are used
in contexts where a Perl string is being processed. This came down to
uses of strchr() and strrchr(). This branch changes many of them to
memchr() and memrchr() respectively. Not all uses need change, as there
are places where C strings are what is being processed, such as dealing
with OS strings that are NUL terminated. File paths and environ are two
examples.
Also, memchr and memrchr tend to be faster than their str equivalents,
as they only need to look for one termination condition, and there may
be hardware assistance on some platforms. Further, memrchr knows
exactly where to start looking, instead of having to find the NUL ending
the string (strrchr is likely to be implemented as iterating over the
string using strchr from the left, over and over until it fails).
I may have converted some str functions to mem ones unnecessarily, as I
didn't check in full detail if some were operating only on C strings, but
given that the mem ones are faster, this is OK
This allows \x and \o to work properly in the face of embedded NULs.
A limit parameter is added to each function, and that is passed to
memchr (which replaces strchr). See the branch merge message for more
information.
M dquote.c
M embed.fnc
M embed.h
M proto.h
M regcomp.c
M toke.c
commit e5f7b40cba44be34986e014a835cb45dbfc8a767
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 11:35:11 2017 -0600
dquote.c: Rmv extraneous #ifdef; add assertions
assert() already does nothing unless -DDEBUGGING; no need to enclose
them in #ifdef DEBUGGING. And this adds another assertionthat is
required to be true on entry to the function.
M dquote.c
commit dfe9517c2730ce21ea90b7d4572f50fafa5ac2e5
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 13:23:27 2017 -0600
perl.c: Convert two uses of strrchr to memrchr
The comments said memrchr would be better to use if we had it, and the
previous commit did add it.
M perl.c
commit 697f47693db149192d53959434f4e24a9b8874f7
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 12:45:34 2017 -0600
Add memrchr()
This is a useful function, lacking on many platforms.
It is left usable only in core, so that if this turns out to have been a
bad idea, it can be easily removed.
M embed.fnc
M embed.h
M inline.h
M perl.h
M proto.h
commit e4ead58ef8d032828d92820d7b7e984b9e3c0040
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 17:38:40 2017 -0600
toke.c: Rmv useless code
This code is unreachable because the code above makes sure that the
variable can't be larger than PL_bufend, and the code is only executed
if it is larger.
M toke.c
commit 6ad598a32e50615f43b65c2917bd4249fc5f04b7
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 15:18:27 2017 -0600
toke.c: White space only
Fix up some white space, including outdenting a block that was doubly
indented
M toke.c
commit f7eb2d707fe1eb915ceb94a0f0f1610b6581c317
Author: Karl Williamson <[email protected]>
Date: Sat Mar 25 14:01:58 2017 -0600
numeric.c: Add comment
M numeric.c
commit 3f7284a0d5ecb71f3cf8b470487f4bd860819b9d
Author: Karl Williamson <[email protected]>
Date: Fri Mar 24 19:01:39 2017 -0600
locale.c: Tighten what is considered a LC variable
Things like LC_CTYPE are locale variables, but not LC_ctype nor
LC__CTYPE. Prior to this commit all were treated as locale variables.
Many platforms have more locale variables than Perl knows about, e.g.,
LC_PAPER, and the code tries to catch all possibilities.
M locale.c
M t/run/locale.t
commit 6ea4a4a8ab2592647113469cadc75423031cbc3b
Author: Karl Williamson <[email protected]>
Date: Fri Mar 24 15:46:55 2017 -0600
locale.c: White-space only
M locale.c
commit cba123c5b56293be47cb72cdbf00ecb771bd876b
Author: Karl Williamson <[email protected]>
Date: Thu Mar 23 19:38:04 2017 -0600
handy.h: Make uniform the defns of strFOO
For consistency
M handy.h
commit 7b9baea6d5bb7a1e5d125b3f18c8d4e07779c237
Author: Karl Williamson <[email protected]>
Date: Tue Mar 14 11:29:53 2017 -0600
Revert "XXX fails due to lack of version bump: Netware: Convert strcmp into
strEQ, strNE"
M NetWare/dl_netware.xs
commit f40769965c425137d5110d43602b551602466837
Author: Karl Williamson <[email protected]>
Date: Thu Mar 9 13:12:23 2017 -0700
XXX fails due to lack of version bump: Netware: Convert strcmp into strEQ,
strNE
The latter two are easier to read
M NetWare/dl_netware.xs
commit 4686493304b72eb43ac4d7d161ed920f43be311a
Author: Karl Williamson <[email protected]>
Date: Thu Mar 9 11:53:48 2017 -0700
locale.c: White space only
Align vertically
M locale.c
commit 86e266983d4e9a31d889f03914f72e4143101ed2
Author: Karl Williamson <[email protected]>
Date: Wed Mar 8 21:55:08 2017 -0700
Convert strncmp into strnEQ, strnNE
The new versions are much easier to comprehend.
There are several cases in vms.c where strEQ and strNE suffice, instead
of having to have a count parameter.
M vms/vms.c
M win32/win32.c
M win32/wince.c
commit 4c0ac083b920c11e026ad033e2d68ad8bdf90a5c
Author: Karl Williamson <[email protected]>
Date: Thu Mar 9 13:13:07 2017 -0700
Convert strcmp into strEQ, strNE
The latter two are easier to read
M cygwin/cygwin.c
M ext/DynaLoader/DynaLoader_pm.PL
M ext/DynaLoader/dl_aix.xs
M ext/DynaLoader/dl_win32.xs
M ext/Hash-Util-FieldHash/FieldHash.xs
M ext/Hash-Util-FieldHash/lib/Hash/Util/FieldHash.pm
M ext/POSIX/POSIX.xs
M ext/POSIX/lib/POSIX.pm
M ext/XS-APItest/APItest.xs
M symbian/symbian_stubs.c
M vms/vms.c
M win32/win32.c
commit c786b6a299df535656db4858c6d146eaf6eef029
Author: Karl Williamson <[email protected]>
Date: Thu Mar 9 11:58:14 2017 -0700
XXX Pull request vsx.inc Use strNE, strNEs
This saves programmer bookkeeping and is easier to read
M vxs.inc
commit 40d6795885190be702fff218d0aa6588461afdb0
Author: Karl Williamson <[email protected]>
Date: Thu Mar 9 12:06:34 2017 -0700
XXX PPPort Cwd: Change strcmp into strEQ
The latter is easier to read
M dist/PathTools/Changes
M dist/PathTools/Cwd.pm
M dist/PathTools/Cwd.xs
M dist/PathTools/lib/File/Spec.pm
M dist/PathTools/lib/File/Spec/AmigaOS.pm
M dist/PathTools/lib/File/Spec/Cygwin.pm
M dist/PathTools/lib/File/Spec/Epoc.pm
M dist/PathTools/lib/File/Spec/Functions.pm
M dist/PathTools/lib/File/Spec/Mac.pm
M dist/PathTools/lib/File/Spec/OS2.pm
M dist/PathTools/lib/File/Spec/Unix.pm
M dist/PathTools/lib/File/Spec/VMS.pm
M dist/PathTools/lib/File/Spec/Win32.pm
commit 25b7d6f15da52a7e653cda1acc04661b5ddeee9e
Author: Karl Williamson <[email protected]>
Date: Thu Mar 9 10:54:20 2017 -0700
XXX PPPort: Data::Dumper: Change some strncmp to strSTARTS_WITHs
The latter is much clearer as to what's going on
M dist/Data-Dumper/Dumper.pm
M dist/Data-Dumper/Dumper.xs
commit 1a12361a63f81a790c1ef48001a141f8f4e16414
Author: Karl Williamson <[email protected]>
Date: Thu Mar 9 10:55:38 2017 -0700
Change some strncmp, strnEQ, strnNE to strSTARTS_WITHs
The latter is much clearer as to what's going on
M cygwin/cygwin.c
M djgpp/djgpp.c
M ext/VMS-Stdio/Stdio.pm
M ext/VMS-Stdio/Stdio.xs
M ext/XS-APItest/APItest.xs
M op.c
M pp.c
M pp_ctl.c
M pp_pack.c
M regcomp.c
M toke.c
M vms/vms.c
M win32/win32.c
commit 00f5baa92b0b89d201eb25d22e56b5fc6d89dbc4
Author: Karl Williamson <[email protected]>
Date: Thu Mar 23 19:00:12 2017 -0600
Use strEQs, strNEs in core files.
This takes advantage of the two macros created in the previous commit,
to produce more legible code.
M ext/XS-APItest/APItest.xs
M gv.c
M hv.c
M mro_core.c
M op.c
M regcomp.c
M scope.c
M sv.c
M toke.c
M vms/vms.c
commit d1200a40b6891d167cf5add24162aa44f2ebc7bc
Author: Karl Williamson <[email protected]>
Date: Thu Mar 23 18:56:19 2017 -0600
Add strEQs, strNEs, for literal final param
If we are comparing two strings, we can skip the actual compare if the
lengths aren't the same (but calculating the lengths ahead of time
negates any savings). However, it turns out that there are a number of
cases in core where the length of one string is known, and the other
string is a literal, hence its length can be calculated by the compiler.
This macro allows those cases to be easily handled, and with shorter
code.
This eliminates programmers from having to count characters.
M handy.h
commit 33810830ec1b7885f8d63278009b9943c6f4ba3a
Author: Karl Williamson <[email protected]>
Date: Wed Mar 8 20:31:25 2017 -0700
XXX new name is tentabive Rename strEQs, strNEs
These names are confusing. The tentative new name is strSTARTS_WITHs. The
two macros are mapped into just that one, complementing the result for
the few cases where strNEs was used.
M amigaos4/amigaio.c
M doio.c
M ext/B/B.pm
M ext/B/B.xs
M ext/XS-APItest/APItest.pm
M ext/XS-APItest/APItest.xs
M gv.c
M handy.h
M hv.c
M locale.c
M os2/os2.c
M perl.c
M toke.c
commit 998af858fc8f6ca1dee61ce3f0f1effadb984842
Author: Karl Williamson <[email protected]>
Date: Fri Mar 3 11:39:57 2017 -0700
t/harness parallel APItest, etc
M t/harness
-----------------------------------------------------------------------
--
Perl5 Master Repository