lua-users home
lua-l archive

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


> Having lua support callbacks to user
> realloc()/alloc() functions would
> also fix this.

I doubt it.  As Virgil pointed out, the real problem
is that there are several instances of the runtime
(and Lua) lib around.  Putting these callbacks in
every lua_State *could* solve the particular
malloc/realloc/free conflict but not the linking issue
in general.  I say "could" because now you *must*
install the correct callbacks as there will be no safe
defaults!

I worked on a different approach to offer the Lua API
to DLL's a while back.  The idea was to offer *all* of
the Lua API calls through an exta function pointer
indirection back into a single incarnation of the Lua
core (that could be linked statically into the main
app.)  To use Lua in a DLL would only require to link
against special lua libs that wrap these indirections
(a bit like import libs really.)  This is all
relatively simple to do (apart from a single vararg
function in the API that is hard/impossible to wrap.)

However, to do it right you really need to set up a
more generic "binary module" system, for which I
didn't want to make time.  I still think that it is an
attractive way to handle Lua binary modules on Win32
though...

--
Wim


__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools