[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C functions with shared state
- From: Tim Hunter <TimHunter@...>
- Date: Mon, 28 May 2007 21:33:07 -0400
JÃrÃme Vuarand wrote:
2007/5/28, Sam Roberts <firstname.lastname@example.org>:
I think Jerome's right the the fenv is more suited. I forgot there isn't
a one-shot for sharing the same upvalue among multiple c functions. I
was thinking of luaL_openlib(), but it requires the seed to be in a
table to be shared.
That's exactly what I meant. You can share the upvalue only if it is
of a type handled by reference in Lua. That is not the case for
numbers, so you have to wrap it in a table, or eventually a full
userdata to gain some speed.
I understand. Thanks for your advice, gentlemen!