[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: local keyword in the global scope, and other things.
- From: "Thomas Harning Jr." <harningt@...>
- Date: Wed, 8 Nov 2006 01:37:18 -0500
On 11/8/06, Jérôme VUARAND <email@example.com> wrote:
2006/11/8, Simon Wittber <firstname.lastname@example.org>:
The function to load a dynamic library is 'package.loadlib'. The
'require' function can also do that if the library is built around the
Lua package model.
And I'd like to add that contrary to what Thomas wrote, loading a
dynamic/shared library the way Lua does it, that is by calling
LoadLibrary/dlopen and then getting a pointer to the functions in the
DLL, is faster than using a stub library and statically linking to
that stub library. The stub static library adds a level of indirection
compared to the use of functions pointer retrieved directly from the
manually loaded dll.
Well.. if you want to call functions with the int fn(lua_State*)
signature... I think what he means is calling into other libraries,
such as opengl/openal/sdl/etc...
Thomas Harning Jr.