[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Discard luaL_Buffer?
- From: "Alexander Gladysh" <agladysh@...>
- Date: Wed, 28 May 2008 00:51:05 +0400
Hi, list!
I have a C function, constructing some long string in luaL_Buffer. In
some rare cases this function may decide that it no longer want that
string, but want to report error to user instead (by returning nil and
error message).
The question is how to discard buffer in this case? Calling
luaL_pushresult() and popping it back seems to be unnecessary
expensive, and setting stack top at where it were before
luaL_buffinit() call seems to be too inpolite. What is the recommended
way to do it?
Thanks in advance,
Alexander.