This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
use SSize_t for string offsets instead of int or socklen_t
authorTony Cook <tony@develop-help.com>
Fri, 7 Oct 2011 09:45:05 +0000 (20:45 +1100)
committerTony Cook <tony@develop-help.com>
Fri, 7 Oct 2011 11:44:29 +0000 (22:44 +1100)
commit0b423688408806ae74227c11283a840c9569d94a
tree4da3878431ddea24b423bbd3c4103fbbfe23e913
parenta05d6c5db36516cdf8d2d7a50e4ca1c5a5f6f2cf
use SSize_t for string offsets instead of int or socklen_t

Note: while I discovered the incorrect types while investigating [perl
described in that report, so I don't consider this a fix for that bug.

Unfortunately to test this change I'd need a scalar at least 2G in
size, which unreasonable for a test we run on each install.

Tested manually on a machine with plenty of memory:

Before:

[tonyc@dromedary perl]$ echo foo | ./perl -le '$x = ""; read(STDIN, $x, 4, 5000000000); print length $x'
705032708

After:

[tonyc@dromedary perl]$ echo foo | ./perl -le '$x = ""; read(STDIN, $x, 4, 5000000000); print length $x'
5000000004
pp_sys.c