Re: [netlabs #607] [PATCH] COW strings (again)

2002-05-21 Thread Dan Sugalski
At 3:09 PM -0400 5/21/02, Mike Lambert wrote: >But I think the strstart is a better idea regardless. It's what perl5 did >anyway, isn't it? That's not necessarily an endorsement of an idea as good... :) -- Dan --"it's

Re: [netlabs #607] [PATCH] COW strings (again)

2002-05-21 Thread Mike Lambert
> 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 bu

Re: [netlabs #607] [PATCH] COW strings (again)

2002-05-21 Thread Dan Sugalski
>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 bufsta

Re: [netlabs #607] [PATCH] COW strings (again)

2002-05-21 Thread Steve Fink
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

Re: [netlabs #607] [PATCH] COW strings (again)

2002-05-21 Thread Dan Sugalski
>*** 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

Re: [netlabs #607] [PATCH] COW strings (again)

2002-05-21 Thread Peter Gibbs
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 lengt

Re: [netlabs #607] [PATCH] COW strings (again)

2002-05-21 Thread Dan Sugalski
At 4:14 PM + 5/21/02, "Peter Gibbs" (via RT) wrote: >* New field 'buffer' in STRING points to the start of the allocated buffer. >I have put this field immediately after the Buffer fields, in case we want >to create a generic subclass of Buffer with the same functionality >* The existing 'bufs

[netlabs #607] [PATCH] COW strings (again)

2002-05-21 Thread Peter Gibbs
vate use by the garbage collector * Parrot_(re)allocate_string changed to add the tail for non-constant strings * Parrot_reallocate_string now takes an additional parameter to specify the flags required for the new buffer * compact_string_pool handles COW strings appropriately; the logic caters for

Re: COW strings

2002-04-02 Thread Peter Gibbs
>> 2) COW must survive garbage collection > > COW can in certain cases, *not* survive garbage collection, specifically The simplest possible implementation of COW strings would be to let the garbage collector 'undo' the COW nature i.e. make multiple copies of all shared bu

Re: COW strings

2002-04-02 Thread Michel J Lambert
> I made two assumptions for my test implementation of COW strings: Wow, you already have a COW implementation? Great to hear! > 1) we need to be able to share substrings as well as complete strings > 2) COW must survive garbage collection > Without these two, I believe the overh

COW strings

2002-04-02 Thread Peter Gibbs
> > Implementing COW is a bit harder, although now that we have a DOD pass, a > lot easier. We can update counts in there...it's just not very easy to see > how we're going to keep track of refcounts. > I made two assumptions for my test implementation of COW strings: