[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: ways to avoid (or speed up) luaL_checkudata() in LuaJIT2?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sat, 6 Nov 2010 07:55:52 -0200
> the problem is that [luaL_checkudata] this function actually needs to
> create a new string in order to do the user data name check at all.
If that is a problem for your application, just write your
own luaL_checkudata and luaL_newmetatable. You can for
instance use void* instead of strings and use a static address
in your library. Lua Socket does or planned to do that:
http://lua-users.org/lists/lua-l/2008-02/msg01282.html
See also these threads
http://lua-users.org/lists/lua-l/2008-02/msg01246.html
http://lua-users.org/lists/lua-l/2004-08/msg00497.html