[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: String lifetime (C API)
- From: Chris <coderight@...>
- Date: Tue, 28 Feb 2006 07:27:12 -0500
My main issue is that when passing a table as a parameter it is a huge
pain to use getfield and then clean everything up before pushing your
return value(s) and returning. Normally function parameters are
always available on the stack and you don't have to pop them before
returning. The table is available on the stack but you can't use
it without putting more stuff on the stack that will need to be cleaned
up later.
If you can getfield and then immediately take the value off the stack that would make the code a lot cleaner.
Or possibly if there was a function like:
const char* lua_getstringfield(lua_State* L, int idx, const char* fieldname)
That would get a string value from a table without putting anything on the stack.
--
// Chris