[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: segfault when lua_newtable called 100 times in a row
- From: "Soni L." <fakedme@...>
- Date: Sun, 10 Apr 2016 15:25:25 -0300
On 10/04/16 02:16 PM, Jura Pk wrote:
Hello, community!
I am stuck with a problem: when I'm trying to add 100 tables in Lua c
stack, I receive segfault on function end.
Code example:
lua_example.c: http://pastebin.com/GFvLwMY2
Makefile: http://pastebin.com/3EWJiVz7
test.lua: http://pastebin.com/1y22XvzK
Maybe I'm doing it wrong? What setting I should increase to be able to
add 100 tables?
local variables limit is 200 by default, registers limit is 254, so I
don't get it.
static int lua_example_test( lua_State *L ) {
for ( int i=0; i<100; i++ ) {
lua_newtable(L);
}
return 1;
}
You need to grow the stack.
--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.