Re: [TCLCORE] [SPAM] [6.0] Re: base64 in the core?
by Lars Hellstrom other posts by this author
Apr 28 2008 4:17AM messages near this date
Re: [TCLCORE] [SPAM] [6.0] Re: base64 in the core?
|
Re: [TCLCORE] [SPAM] [6.0] Re: base64 in the core?
Donal K. Fellows skrev:
> Larry McVoy wrote:
> > Can you explain that a bit? I'm thinking something like
> >
> > when we detect a foreach (c in buf)
> > bump the refcount on buf
> > set an index at 0
> > start the loop
> > each iteration
> > c = buf[index++]
> > loop body
> > decr refcount on c
> > decr refcount on buf
> >
> > What's so hard about that? I realize I'm asking this naively so I'm not
> > say "you wuss, go do it", I'm say "teach me why this is hard, please".
>
> The problem is that lots of code has to be rewritten to understand
> keeping a reference count on the buffer, or rather on the string rep[*].
[snip]
> [* Some of our strings have internal representations that allow us to
> process them much more efficiently. This was important for avoiding
> the costs that would otherwise be incurred from using UTF-8, and was
> the main way that we recovered from the slowdown in Tcl 8.1... ]
Just verifying that I understood this correctly, because your
objections sounded really strange on a first read-through. Is it true that:
1. It's not possible to iterate over the String intRep like this,
unless one reimplements it to have a separate refcount, because
shimmering could cause it to go away.
2. The same problem exists for bytearray intReps.
3. It would be possible to iterate over the string representation
*bytes instead, because that cannot go away unless the value is
modified. (An earlier remark "index into buf? Module unicode char
widths, etc." by Larry gave me the impression he intended to iterate
over UTF-8 encoded data.)
?
Lars Hellström
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Tcl-Core mailing list
Tcl-Core@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Thread:
Trevor Davel
Pat Thoyts
Kevin Kenny
Donal K. Fellows
Larry McVoy
Donal K. Fellows
Larry McVoy
Donal K. Fellows
Kevin Kenny
Donal K. Fellows
Larry McVoy
Donal K. Fellows
Alexandre Ferrieux
Lars Hellstrom
Donal K. Fellows
Alexandre Ferrieux
Donal K. Fellows
Alexandre Ferrieux
Donal K. Fellows
Alexandre Ferrieux
Larry McVoy
|