Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76955 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64971 invoked from network); 29 Aug 2014 15:55:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Aug 2014 15:55:10 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:55398] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/E6-22920-B52A0045 for ; Fri, 29 Aug 2014 11:55:09 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id A7B642400E1; Fri, 29 Aug 2014 11:55:04 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id plkF4ZFJOTgb; Fri, 29 Aug 2014 11:55:04 -0400 (EDT) Received: from [192.168.0.2] (05439dda.skybroadband.com [5.67.157.218]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id E247A2400C3; Fri, 29 Aug 2014 11:55:01 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <2afc5a878ff4c780c74f4604f77525c1.squirrel@webmail.klapt.com> Date: Fri, 29 Aug 2014 16:54:59 +0100 Cc: internals@lists.php.net, Nikita Popov , Pierre Joye , Dmitry Stogov , Laruence Content-Transfer-Encoding: quoted-printable Message-ID: <38C2ECB6-F38E-47C2-8C34-640FF0271FF7@ajf.me> References: <2afc5a878ff4c780c74f4604f77525c1.squirrel@webmail.klapt.com> To: Anatol Belski X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] 64 bit string offsets From: ajf@ajf.me (Andrea Faulds) On 29 Aug 2014, at 16:49, Anatol Belski wrote: > Hi, >=20 > while refining the big string support, it turned out that we've an = issue. > The syntax like $s[42] =3D 'x'; is currently inconsistend, because we = have > uint32 for string offsets. This actually means, the behaviour is = currently > only available in the old style and can handle not more than 2gb big > strings. >=20 > Also discussed with Laruence on IRC and he actually expressed the = concern > that we pay overhead on that. =46rom my side I was investigating on = that and > could suggest several solutions for that: >=20 > - stay with the old behavior (indexes would be able to handle only 2gb > strings, this is the status quo) > - implement a function like in JS String.charAt() as alternative > - turn to some temp_variable solution we currently have in PHP5. = Laruence > told be that dropping temp_variable was one of the improvementes. > Actually, the string index functionality is utilized in two opcodes, = so > maybe that were just a local case. >=20 > Anyway not talking about touching zval, as that would grow by 8 bytes = with > a size_t str_offset. Just maybe there were another solution I oversee? We don=92t need to actually support >2GB string indexing realistically. = As I understand it, we=92re using size_t because it=92s the proper type = for string lengths, not because we need >2GB strings. I=92d just leave things as they are=85 though I suppose there might be = some benefit to switching to size_t for string offsets. Does that avoid = a cast in the generated assembly? -- Andrea Faulds http://ajf.me/