From: Jarkko Hietaniemi Date: Sat, 22 Jan 2005 11:33:12 +0000 (+0200) Subject: Re: uc($long_utf8_string) exhausts memory X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=32c480af8dfd9e34b5575597dcf51e893e97e167;p=p5sagit%2Fp5-mst-13.2.git Re: uc($long_utf8_string) exhausts memory Message-Id: <41F21DD8.3050500@iki.fi> change #23857 miscalculated the SvGROW size p4raw-link: @23857 on //depot/perl: 89ebb4a3f2a55825eeed13aaf58db5c73d2140ef p4raw-id: //depot/perl@23863 --- diff --git a/pp.c b/pp.c index 12f5bfb..09b0c7c 100644 --- a/pp.c +++ b/pp.c @@ -3597,9 +3597,9 @@ PP(pp_uc) /* If someone uppercases one million U+03B0s we * SvGROW() one million times. Or we could try - * guess how much to allocate without overdoing. - * Such is life. */ - SvGROW(TARG, SvCUR(TARG) + ulen - u); + * guessing how much to allocate without allocating + * too much. Such is life. */ + SvGROW(TARG, SvLEN(TARG) + ulen - u); d = (U8*)SvPVX(TARG) + o; } Copy(tmpbuf, d, ulen, U8); @@ -3695,9 +3695,9 @@ PP(pp_lc) /* If someone lowercases one million U+0130s we * SvGROW() one million times. Or we could try - * guess how much to allocate without overdoing. - Such is life. */ - SvGROW(TARG, SvCUR(TARG) + ulen - u); + * guessing how much to allocate without allocating. + * too much. Such is life. */ + SvGROW(TARG, SvLEN(TARG) + ulen - u); d = (U8*)SvPVX(TARG) + o; } Copy(tmpbuf, d, ulen, U8);