lua-users home
lua-l archive

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


Joshua Jensen wrote:
----- Original Message -----
From: Tim Mensch
Date: 4/24/2009 2:39 PM
LuaPlus is pretty heavy, but you can grab just the LuaPlus Call Dispatcher (luapluscd.h) and use it on its own--that would at least allow you to trivially call C++ member functions from within Lua. I do that in Playground SDK.
I hear this often. Under Visual Studio 2008, the most minimal LuaPlus adds 4 kilobytes to the size of the executable. I'm not convinced it is even a full 4k; the size of the executable just grows by that much. There was once a Playground SDK forum posting about LuaPlus adding 100k to the image size. This occurred when the function to add the standard set of Lua libraries was in the same compilation unit as the function that just initialized the Lua state without standard libraries. When these two functions were separated, this problem went away.
OK, good to know. It's too bad I didn't know about that years ago, or LuaPlus would probably have been more fully integrated into Playground. As it is, we're using the LuaPlus-modified Lua code and LuaPlusCD, but that's it. At this point we've already decided to move away from LuaPlus (except for LuaPlusCD) for 5.0, so that we can add LuaJIT/LuaCoco without fear of patch conflicts. There are other reasons: Reference counting didn't work for us (it would crash reliably when it was turned on--this was ~3 years ago, though, so probably has been fixed), which didn't inspire confidence, and simply not using the plain-vanilla distribution of Lua meant that we won't have to worry about whether any other crashes have to do with LuaPlus conflicts or modifications. We also use UTF-8, so there's no need for the extra complexity of wide-strings.

Will the LuaPlus C++ wrappers work without the customized Lua core? I suspect the answer is no, which is why I haven't tried. Otherwise, if they really did just add about 4k of overhead, I really should look at LuaPlus again.

Tim