mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-11 16:42:44 +02:00
luaL_setstate() uses malloc() to initialize the first objects, and only after this we replace the allocator. This creates trouble when replacing the standard memory allocators during debugging sessions since the new allocator is used to realloc() an area previously allocated using the default malloc(). Lua provides lua_newstate() in addition to luaL_newstate(), which takes an allocator for the initial malloc. This is exactly what we need, and this patch does this and fixes the problem. The now useless call to lua_setallocf() could be removed. This has no impact outside of debugging sessions and there's no need to backport this.