lua-users home
lua-l archive

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


Luiz Henrique de Figueiredo wrote:
- light C functions

Are these just optimized C functions with no stack frame (and no C closure) as I infer from the (work) 5.2 manual, or is there any other difference?

I'm asking because I found Mike Pall's old suggestion (http://lua-users.org/lists/lua-l/2006-09/msg01011.html): "Add a kind of "light" C functions. This avoids building up a call frame for every function call. These functions are a bit more restricted (like no callbacks into Lua)"

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?

  Enrico