lua-users home
lua-l archive

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


Curious if anyone has attempted this on WIN32 using mingw or VC++?
The libmmalloc.a included with MingW gcc (though I'm not sure at
the moment if it came with gcc or gdb) complains about unesolved
references to 'sbrk' (I rummaged around in the gdb sources to
find header to use with this lib).  I've Googled for another
Windoze friendly mmalloc implementation but so far without great
success.  Am I headed in the wrong direction?

Thanks,
Dean.

At 03:05 PM 7/17/2003 -0300, Luiz Henrique de Figueiredo wrote:
Motivated by the post by André de Leiradella on using GNU mmalloc with Lua,
I've packaged some code for those who want to try it with minimal hassle:
        http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/plua.tar.gz
The code is mainly a redefinition of lua_open, lua_close, l_realloc, and l_free
to use routines in mmalloc. It also shows what can be done without touching
Lua's source code. See the Makefile.

Simple examples work ok. One issue is the registration of C functions: correct
behaviour seems to rely on the interpreter registering all C function again
at each invocation. Of course, it does that for the standard libraries, but
storing a C function in a table field in one instance and them trying to run
it in a later instance may not work. André has experimented with proxies for
C functions and it seems to work, but the package above does not include this;
it is mostly for those who want to play with it -- persistent states does add
a new perspective and will be really useful if it can be made to work well.

Those interested in mmalloc should read
        http://sources.redhat.com/gdb/5/onlinedocs/mmalloc.html

Enjoy.
--lhf

--
E-Mail:  sessile@in-gen.net