lua-users home
lua-l archive

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


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?