Re: Copy-on-write strings

2002-05-10 Thread Graham Barr
On Fri, May 10, 2002 at 12:12:41PM -0400, Dan Sugalski wrote: > At 5:38 PM +0200 5/10/02, Peter Gibbs wrote: > >The result is that the last header of a COWed string will still believe that > >the buffer is shared until a GC collection run occurs, and therefore could > >result in buffers being copi

Re: Copy-on-write strings

2002-05-10 Thread Dan Sugalski
At 5:38 PM +0200 5/10/02, Peter Gibbs wrote: >The result is that the last header of a COWed string will still believe that >the buffer is shared until a GC collection run occurs, and therefore could >result in buffers being copied unnecessarily. Your system eliminates this >problem; however, I bel

Re: Copy-on-write strings

2002-05-10 Thread Peter Gibbs
Hi Nicholas The final design is now waiting on Dan, but it is always interesting to see other ideas. Like you, I rejected the parent/child technique. However, my proposed solution did not use any links at all, because it relies on the garbage collection system to determine when a shared buffer h

Re: Copy-on-write strings

2002-05-09 Thread Peter Gibbs
- Original Message - From: "Dan Sugalski" <[EMAIL PROTECTED]> > 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

Re: Copy-on-write strings

2002-05-09 Thread Dan Sugalski
At 10:58 AM +0200 5/6/02, Peter Gibbs wrote: >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 p

Copy-on-write strings

2002-05-06 Thread Peter Gibbs
Although the tidying up of resources.c is not complete yet, I decided to implement COW strings anyway. This implementation handles the following: Copied strings and substrings are COWed instead of copied (i.e. new string header only); this applies to normal and constant strings. Functions that al