[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] luaffi (ffi library ala luajit's for the standard lua vm)
- From: James McKaskill <james@...>
- Date: Mon, 18 Jul 2011 09:01:09 -0400
On Mon, Jul 18, 2011 at 00:47, Javier Guerra Giraldez
<javier@guerrag.com> wrote:
> On Sun, Jul 17, 2011 at 11:21 PM, James McKaskill <james@foobar.co.nz> wrote:
>> The bad:
>> - 64bit support is broken. It was actually broken before, but you
>> would only hit it if your allocator returned pointers > 4GB.
>
> isn't LuaJIT similarly limited? i think all Lua objects are
> constrained to 1GB...
It does this by using a special allocator.
Note that the issue is not if you allocate more than 4GB, but if the
pointer values are greater than 2^32.
>
>
>> The callbacks are done by jitting an appropriate stub whose lifetime
>> is tied to the lua function. Also its currently hard coded to use the
>> lua_State that was present when the lua function was converted to a
>> function pointer.
>
> if i understand it correctly, this sounds reasonable; since a
> different lua_State isn't guaranteed to contain the same Lua function.
> IOW: a specific Lua function implicitly specifies a specific
> lua_State, right?
The problem crops up wrt to lua coroutines. Each coroutine has a
seperate lua_State*. The callback is hard coded with the coroutine
that was active at the time it was created. This is an issue if that
thread is not ready (its resumed another thread, is currently yielded,
or has been garbage collected).
-- James