[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: segfault when lua_newtable called 100 times in a row
- From: "Soni L." <fakedme@...>
- Date: Sun, 10 Apr 2016 19:10:32 -0300
On 10/04/16 07:01 PM, Nagaev Boris wrote:
On Sun, Apr 10, 2016 at 9:54 PM, Soni L. <firstname.lastname@example.org> wrote:
On 10/04/16 06:49 PM, Nagaev Boris wrote:
On Sun, Apr 10, 2016 at 8:44 PM, Soni L. <email@example.com> wrote:
On 10/04/16 05:06 PM, Nagaev Boris wrote:
On Sun, Apr 10, 2016 at 6:40 PM, Jura Pk <firstname.lastname@example.org> wrote:
Problem solved, thanks to Shmuel Zeigerman and Soni L.
After wrapping in lua_checkstack, the code works perfectly even with
Seems, like lua_checkstack grows the stack =)
2016-04-10 21:27 GMT+03:00 Shmuel Zeigerman <email@example.com>:
On 10/04/2016 20:16, Jura Pk wrote:
I am stuck with a problem: when I'm trying to add 100 tables in Lua c
stack, I receive segfault on function end.
By the way, why not to grow the stack automatically in pushing API
Because of overhead. Imagine checking the stack every operation vs
the stack once for 1000 operations, or however many you need.
If the stack has room for new element, than the check is just one
comparison, which would be perfectly predicted.
And a branch.
... perfectly predicted branch
And it still has a cost. It's not free.
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.