Александр Киранов wrote: > How I can work with unsigned long long values as cdata in C functions using > usual LUA stack operations (as required for SWIG)? You can't. At least not without diving into internals, which is strongly disrecommended. The classic Lua/C API and FFI cdata don't mix well. Presumably, you're using LuaJIT for its speed benefits. These are almost completely negated by using a) the classic Lua/C API and b) SWIG or other binding generators. If you don't want to rewrite your C bindings and/or you haven't benchmarked whether the code on the Lua side is actually CPU intensive, then better stick with plain Lua. --Mike