On Mon, Jul 02, 2001 at 04:12:31PM -0400, Dan Sugalski wrote:
> At 09:07 PM 7/2/2001 +0100, Graham Barr wrote:
> >On Mon, Jul 02, 2001 at 03:52:34PM -0400, Dan Sugalski wrote:
> > > At 08:36 PM 7/2/2001 +0100, Simon Cozens wrote:
> > > >On Mon, Jul 02, 2001 at 03:00:54PM -0400, Dan Sugalski wrote:
> > > > > >what about starting offset? that is used now to shorten a string from
> > > > > >the left side.
> > > > >
> > > > > D'oh! In. Out goes the unused.
> > > >
> > > >Whoa there. Do we still actually want to do this? It's unclear whether
> > > >or not it's actually a net win.
> > >
> > > A valid point. It doesn't seem to be used at all often, but it's always
> > > tough to equate frequency of appearance to frequency of usage.
> >
> >I for one use s/^...// quite often in the knowledge that it is optimized to
> >just move a pointer and not cause a copy of the string.
>
> We'll still be doing that.
Then I misread the mails, ignore me.
> (The leftover memory will get cleaned up when we
> GC) The bigger issue is when we need to move the pointer back because we've
> stuck something back on the front of the string.
Surly the buffer holding the string would just be a malloc'd buffer
and not GC'd (I was assuming GC would only be for the PMC) In which
case you need to remember the start of the buffer for free.
But if the string buffer is to also be GC'd then I would agree that
there is little benefit from trying to reuse memory at the front
of the buffer.
Graham.