lua-users home
lua-l archive

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

Wim Couwenberg wrote:

Jay Carlson wrote:

*g->realloc is win32's fault.  You now know where to send your mailbombs.

Care to explain?

Already wrote this in private mail; less certain now:

On reflection, I'm not all that certain that it's win32. But on ELF systems, it's easy to substitute a new malloc for the entire application (just define realloc). It's also easy to compile Lua to use its own custom allocator, using #define.

The three cases for the runtime hook (as opposed to a compile-time hook) are:

1) You want different allocators for different states

2) You want to have a single "standard" DLL or .so file to reduce the number of versions floating around.

3) Your program and its shared libraries can't agree which allocator to use. This is the Win32 problem I was mudslinging at.