[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.2.0 (work3) now available
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 18 May 2010 17:12:40 -0300
> 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.