lua-users home
lua-l archive

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

Suggestions (off top of my head) :-
* Flag in toLua to generate conditional flags around argument checking code so I can use it conditionally. ie. if I am happy the code is all working I could turn arg checking off for extra performance in release version.
static int toluaI_ming_mingError00(lua_State* tolua_S)
 if (
 !tolua_istype(tolua_S,1,LUA_TSTRING,0) ||
 goto tolua_lerror;
  char* tolua_var_1 = ((char*)  tolua_getstring(tolua_S,1,0));
 return 0;
 tolua_error(tolua_S,"#ferror in function 'mingError'.");
 return 0;
This could possibly be: tolua -argsflag CHECK_ARGS
so you can change the name of the flag generated (eg. to _DEBUG) easily.
* Static functions in tolua generated wrapper to generate error messages:
 tolua_error(tolua_S,"#ferror in function 'mingError'.");
could be
makeferror(char *fn)
    char e[256];
    sprintf("#ferror in function '%s'",fn);
if you get my drift. Just a slight memory optimisation when you have a couple of hundred functions.
* Can you put the included header eg. $#include "myheader.h" at the very top of the file so my precompiled headers work properly! eg. in Borland.

#include "tolua.h"
/* Exported function */
int tolua_min_open (lua_State* tolua_S);
void tolua_min_close (lua_State* tolua_S);
#include "minpch.h"
#pragma hdrstop
#include "gui/gui.h"
ie. #include "minpch.h" etc. should go before the exported fns.
----- Original Message -----
Sent: Monday, January 15, 2001 3:49 PM
Subject: tolua 4.0a

> >    I was just wondering how the new, more efficient, version of toLua was
> >    coming along. Current version works fine with 4.0 but there was talk of
> >    improving the effieciency of it?

I plan to release an official release soon,
but to truly gain effieciency we need features
that will be available only with Lua 4.1.

> It works??? Where did you get it?
> My version is tied to Lua 3.x

For those who missed my original message:


there is a alpha version available at

I am still working on its performance, and will probably change
the code (not the interface) in the next days.
Also, the docs are not up-to-date.

The main changes are:
- Lua 4.0 compatible (tolua is now reentrant)
- new support for 'bool' type (mapped to Lua  as 1 or nil)
- new support for extracting .pkg instruction from real header file
- fixed bugs reported in this list.
- no support for overloading relational operators: <=, >=, > (it
supports < only)
- the option -a is no longer support (we need the lua state to initalize

feedbacks, suggestions and bug reports are very wellcome.

-- waldemar