[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.2.0 (work3) now available
- From: Mark Hamburg <mark@...>
- Date: Fri, 21 May 2010 21:19:19 -0700
On May 18, 2010, at 1:12 PM, Luiz Henrique de Figueiredo wrote:
>> But I see that lua_pushcfunction is just a macro for lua_pushcclosure:
>> #define lua_pushcfunction(L,f) lua_pushcclosure(L,f,0)
>> and lua_pushcclosure(L,f,0) creates a light C function, so I guess Lua
>> callbacks from light C functions are allowed. Is this so?
> Yes. Light C functions are exactly like current C functions except that they
> don't have upvalues. It's an implementation optimization and one that has
> shown to save a good amount of memory. Moreover, light C functions can be
> sent to Lua without fearing memory allocation errors.
Bravo. I've wanted those for a while -- in particular for the last issue -- though the revisions to lua_cpcall seemed to make it less critical.