[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: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 21 Apr 2014 12:37:31 -0300
> 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