[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to pass arguments to argv function effectively in Lua C API
- From: Tony Finch <dot@...>
- Date: Thu, 24 Mar 2011 12:26:24 +0000
Tony Finch <dot@dotat.at> wrote:
>
> /* lay out all the arrays within a userdata object */
> args = lua_newuserdata(L, total);
> argv = (void *)(args + args_size);
> argl = (void *)(args + args_size + argv_size);
Er, sorry, that can screw up the alignment restrictions.
Try this instead:
args = lua_newuserdata(L, total);
argv = (void *)args; args += argv_size;
argl = (void *)args; args += argl_size;
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
South-east Iceland: Cyclonic 4 or 5, increasing 5 to 7 for a time in north.
Moderate or rough. Occasional rain. Moderate or good.