[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Modules for iconv (Was: UTF-8 patterns in Lua 5.3)
- From: Coroutines <coroutines@...>
- Date: Mon, 21 Apr 2014 14:22:23 -0700
On Mon, Apr 21, 2014 at 8:37 AM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> The main benefit of using variable-length arrays is allocating on the
>> stack, which can also be done with alloca() -- both avenues not
>> possible with C89. Going the route of luaL_Buffer would still
>> allocate on the heap (internally using Lua's set allocator function --
>> which looks like realloc). [...]
>
> luaL_Buffer only allocates on the heap after a certain size limit
> (typically 8 KB). Otherwise it uses the stack.
>
> -- Roberto
>
The C stack or the Lua stack?