lua-users home
lua-l archive

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

Tracing a crash when sorting strings on an embedded system, I noticed that l_strcmp() in lvm.c (line 201) calls strcoll() that, in turn, calls malloc() on this system, bypassing the Lua allocator and so (in my case) causing trouble. Of course malloc() is nothing unusual in C, but I'm working in C++ with 'new' and 'delete' (as well as the Lua allocator) redefined to use a custom heap.

I know there's little the Lua developers could (or should) do about this, apart perhaps for giving the opportunity to redefine locale-related functions, or just to ignore locale. I'm writing just to warn people using a separate allocator: beware of hidden, indirect allocation calls from inside Lua.

I wonder what others surprises to expect on this system :-)
(any idea where hidden mallocs could lurk? I'm only using the table library)