On Tue, May 21, 2002 at 01:38:45PM -0400, Dan Sugalski wrote: > At 5:27 PM +0000 5/21/02, "Peter Gibbs" (via RT) wrote: > > > I think I'd like these differently. STRING is a subclass of Buffer, > >> and the bufstart and buflen fields in Buffers point to the actual > >> start of memory and length of allocated data. I'd rather keep it that > >> way, and have the 'real' string length and string start be extra > >> fields in the STRING part. > > > >Quote from > >http://www.mail-archive.com/perl6-internals@perl.org/msg09497.html: > >>The COWing of substrings requires a major interface change: > >>*** All references to the data in a STRING must use the new strstart > >pointer > >>instead of bufstart *** > > > >Actually, we don't. (Sez the man catching up on altogether too much > >mail) Since we're putting the COW stuff at the tail end, substrings > >of COW strings are fine. You set the bufstart to where the substring > >starts, buflen set so it goes to the end of the original buffer, and > >the string length bit holds the real string length. That way you > >start where you need to, but you can still find the COW marker off > >the end of the original buffer. > >[End quote] > > Either I was thinking of something else, or being rather stupid > there. Either way, it seems inappropriate for what you're > doing.Leaving the Buffer bits to point to the real buffered data and > leaving the string bits to do all the magic twiddly substring bits > seems more appropriate at the moment. > --
<ouch> That's exactly what Peter's original COW patch did. It was called strstart. Peter, I think you forgot to attach the new patch.