Re: 64 bit string offsets

From: Date: Fri, 29 Aug 2014 16:34:25 +0000
Subject: Re: 64 bit string offsets
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-76956@lists.php.net to get a copy of this message
On Fri, Aug 29, 2014 at 11:49 PM, Anatol Belski <anatol.php@belski.net> wrote: > Hi, > > while refining the big string support, it turned out that we've an issue. > The syntax like $s[42] = '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. > > Also discussed with Laruence on IRC and he actually expressed the concern > that we pay overhead on that. From my side I was investigating on that and > could suggest several solutions for that: > > - stay with the old behavior (indexes would be able to handle only 2gb > strings, this is the status quo) I think it's okey. maybe throw a warning if it's bigger than 32bits? if a string is bigger than 2^32... I think there must be a bug.... :) thanks > - 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. > > 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? > > Regards > > Anatol -- Xinchen Hui @Laruence http://www.laruence.com/

« previous php.internals (#76956) next »