Jeff Clites <[EMAIL PROTECTED]> wrote:

> ab\x{212b}de  //clength is 12
> ----------^

> ... end up with is 5 (2 + 1 + 2)

Ok, ok. You are right. As the string goes into constants and isn't
changed, we'll do it right, which is, as metioned,

  d + 1 + length_todo

> [Note: _string_upscale is currently simple, but not optimized. We
> should enhance it for the case where we can upscale in place because we
> know that we have enough storage already allocated accommodate
> max(passed in length, current length). That's what would let the above
> be a savings.]

It should probably only allocate the string memory - no header. As in
unmake_COW() s. "STRING for_alloc;". Then copy over the memory bits.
You can't reallocate the string though. When it's possible in
place--better.

And finally *all* string allocation functions need the flags to decide
if to use constants pools or not (e.g. string_make_empty).

> JEff

leo

Reply via email to