lua-users home
lua-l archive

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


On 10/02/2015 12:01 PM, Marc Balmer wrote:
When I pass precompiled Lua bytecode to Lua using lua_loadXXX functions by passing a pointer to the bytecode in memory (e.g. after mmaping the file containing the byte code into memory), will that directly be used or will there new memory be allocated and the bytecode be copied?

- Marc



In my application, I am reusing the same buffer that I pass to lua_loadXXX many, many times. So I can empirically ensure you that the byte code is copied.

You can also test this by adding a breakpoint or print in your lua_Alloc function.
--
Thomas