lua-users home
lua-l archive

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

I have lua embedded in a C++ application that does a lot of lua calls (thousands) and I can't seem to be able to keep my stack in order.

If I don't do anything (don't pop values, don't use checkstack and don't use lua_settop(L, 0)) I run out of memory, no surprise there.

Unfortunately, when I try to reduce my stack periodically (by pop-ing or using lua_settop) my stack eventually gets corrupted and I get access violations when using lua_call.

How is proper stack handling supposed to be done?

Oskar Forsslund