lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 17-May-05, at 7:08 AM, Mike Pall wrote:

You'd need a new internal type value for that. And then special
case all equality comparisons.


 And provide for some way to migrate
a stack string to a (unique) heap string (and back?).

No. It would just be an object, like a Number. You'd never have to
heapify it.

 And I bet there are a few more pitfalls.

Possibly. But it might still be worth it.

I can think of only one use case: processing lots of short strings
in sequence (passing them back and forth to string.* functions).

Exactly. But that's not uncommon.

But as soon as you store a string in a table or index a table with it,
you pay the heap allocation overhead, anyway.

See above,