lua-users home
lua-l archive

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


let me clarify. I do it like this:

lua_cfunction func = lua_tocfunction(L, -1);
func(L);

that shouldn't need any lua involvement right?

On Tue, Oct 18, 2011 at 1:34 PM, Oskar Forsslund <matrixsmurfen@googlemail.com> wrote:
but i dont need to do lua_call on it, i just call it like any function pointer


On Tue, Oct 18, 2011 at 1:30 PM, Jerome Vuarand <jerome.vuarand@gmail.com> wrote:
2011/10/18 Oskar Forsslund <matrixsmurfen@googlemail.com>:
>>
>> But what you did was just shuffling around the calls.
>
> Is it? Now i only do one c_call from lua and the other calls (I believe) are
> now pure c++ calls which should be faster

In your original example, you pass some_c_call1 as a parameter, so one
can only assume it is a lua_CFunction and that you have to lua_call
it. And a lua_call is nothing near a pure C++ call.