[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade)
- From: Coroutines <coroutines@...>
- Date: Thu, 27 Mar 2014 11:57:18 -0700
On Thu, Mar 27, 2014 at 4:22 AM, Peter Melnichenko
<petjamelnik@yandex.ru> wrote:
> Tim Hill wrote:
>> It already does. In fact it uses a rather clean algorithm to perform a pretty optimal number of allocations/copies during the concatenation. See PiL for more information.
>
> IIRC starting from Lua 5.2 luaL_Buffer(used internally by table.concat) is a simple buffer, doubling in size when it overflows, and not the "Tower of Hanoi" described in PiL.
>
> Peter
>
I believe std::string's in C++ allocate in the same way, also
std::vector's. The Tower of Hanoi concatenating thing is useful for
keeping memory down to the sqrt() of the n-many strings you will have
to concatenate (iirc).
- References:
- Re: [ANN] Lua 5.3.0 (work2) now available, Andrew Starks
- Re: [ANN] Lua 5.3.0 (work2) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), katlogic
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Roberto Ierusalimschy
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Hisham
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Rena
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), William Ahern
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Andrew Starks
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Dirk Laurie
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Oliver Kroth
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Oliver Kroth
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Tim Hill
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Peter Melnichenko