CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sun, 27 Jul 2025 20:28:06 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20140223110559
location: https://web.archive.org/web/20140223110559/https://perl5.git.perl.org/perl.git/commitdiff/HEAD
server-timing: captures_list;dur=0.691907, exclusion.robots;dur=0.026673, exclusion.robots.policy;dur=0.011867, esindex;dur=0.013152, cdx.remote;dur=1285.931211, LoadShardBlock;dur=329.356527, PetaboxLoader3.datanode;dur=209.338501, PetaboxLoader3.resolve;dur=65.469397
x-app-server: wwwb-app216
x-ts: 302
x-tr: 1648
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app216; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Sun, 27 Jul 2025 20:28:07 GMT
content-type: text/html; charset=utf-8
x-archive-orig-date: Sun, 23 Feb 2014 11:05:59 GMT
x-archive-orig-server: Apache/2.2.3 (CentOS)
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 23 Feb 2014 11:05:59 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 26 Oct 2013 04:38:21 GMT", ; rel="prev memento"; datetime="Tue, 26 Nov 2013 17:55:45 GMT", ; rel="memento"; datetime="Sun, 23 Feb 2014 11:05:59 GMT", ; rel="last memento"; datetime="Sun, 23 Feb 2014 11:05:59 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: alexa20140225-12/51_38_20140223110505_crawl102.arc.gz
server-timing: captures_list;dur=0.747880, exclusion.robots;dur=0.024157, exclusion.robots.policy;dur=0.011474, esindex;dur=0.012638, cdx.remote;dur=448.183257, LoadShardBlock;dur=270.752516, PetaboxLoader3.resolve;dur=237.554148, PetaboxLoader3.datanode;dur=132.018251, load_resource;dur=117.719468
x-app-server: wwwb-app216
x-ts: 200
x-tr: 885
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
perl5.git.perl.org Git - perl.git/commitdiff
author | Father Chrysostomos <sprout@cpan.org> | |
Mon, 17 Feb 2014 06:25:27 +0000 (22:25 -0800) | ||
committer | Father Chrysostomos <sprout@cpan.org> | |
Sat, 22 Feb 2014 14:20:02 +0000 (06:20 -0800) |
sv_grow provides an extra byte for the sake of copy-on-write’s buffer
reference count, but skips this for multiples of 256 (though the com-
ments there say powers of two).
When we do
$input=<>
The assignment is optimised away and the allocation takes place in
sv_gets. In that code path, we know we don’t need a nice power of
two and allocating an extra byte won’t hurt, so go ahead and add an
extra byte.
This speeds up code doing m//g on $input, because it avoids the pre-
match copy.
reference count, but skips this for multiples of 256 (though the com-
ments there say powers of two).
When we do
$input=<>
The assignment is optimised away and the allocation takes place in
sv_gets. In that code path, we know we don’t need a nice power of
two and allocating an extra byte won’t hurt, so go ahead and add an
extra byte.
This speeds up code doing m//g on $input, because it avoids the pre-
match copy.
sv.c | patch | blob | blame | history |
--- a/sv.c
+++ b/sv.c
if (!PerlLIO_fstat(PerlIO_fileno(fp), &st) && S_ISREG(st.st_mode)) {
const Off_t offset = PerlIO_tell(fp);
if (offset != (Off_t) -1 && st.st_size + append > offset) {
- (void) SvGROW(sv, (STRLEN)((st.st_size - offset) + append + 1));
+ (void) SvGROW(sv, (STRLEN)((st.st_size - offset) + append + 1
+#ifdef PERL_NEW_COPY_ON_WRITE
+ /* Add an extra byte for the sake of copy-on-
+ write's buffer reference count. */
+ + 1
+#endif
+ ));
}
}
rsptr = NULL;