develooper Front page | perl.perl6.internals | Postings from July 2001

Re: PDD 4, version 1.2.

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
July 2, 2001 13:31
Subject:
Re: PDD 4, version 1.2.
Message ID:
5.1.0.14.0.20010702162413.02126e30@24.8.96.48
At 09:19 PM 7/2/2001 +0100, Graham Barr wrote:
>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.

It wasn't in the original mails--it hadn't occurred to me originally that 
the fact we'd have a copying garbage collector would let us drop bytes on 
the floor with impunity.

> > (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.

Nope. All the string buffers will be GC'd, as will all the variable-length 
data buffers. GC's a bigger win in those cases than when managing 
fixed-length  things. (Though there's a reasonable win there, too)

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About