lua-users home
lua-l archive

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

On 1 March 2017 at 08:56, Valerio Schiavoni <> wrote:
> Hello
> is it possible somehow to measure how much time the LuaVM spends to allocate
> heap memory during the execution of a program?
> Is there some debug flag that shows this information?
> Thanks
> --
> Valerio

You could do so by writing own allocator that takes a timing measurements.
You can either use lua_setallocf() if you're wrapping the existing
allocator, or otherwise pass your own allocator to lua_newstate().